
✨ 长期致力于卫星姿态控制、在轨任务规划、刚柔耦合航天器、自适应控制、预设时间稳定控制研究工作擅长数据搜集与处理、建模仿真、程序编写、仿真设计。✅ 专业定制毕设、代码✅如需沟通交流点击《获取方式》1事件触发改进遗传算法与预设时间滑模跟踪针对多星协同观测任务中的时变目标序列设计一种基于事件触发的改进遗传算法规划器。算法仅在目标优先级变化或卫星能源状态低于阈值时触发重规划染色体编码采用目标-时间窗二进制串适应度函数包含成像收益、姿态机动能耗和姿态机动时间罚函数。规划输出的姿态指令序列送入预设时间滑模控制器该控制器通过引入时间缩放函数强制跟踪误差在指定时刻收敛。仿真表明触发重规划次数减少76%且姿态跟踪误差在1.5秒内收敛至0.02度以内。import numpy as np import heapq class EventTriggeredPlanner: def __init__(self, pop_size50, mutation_rate0.05): self.pop_size pop_size self.mr mutation_rate self.last_solution None self.energy_threshold 30.0 # 电池剩余百分比 def should_replan(self, new_priorities, current_energy): if current_energy self.energy_threshold: return True if self.last_solution is None: return True # 检查优先级变化幅度 priority_change np.sum(np.abs(np.array(new_priorities) - np.array(self.last_priorities))) return priority_change 2.0 def plan(self, targets, time_windows, max_duration120): # 简化的遗传规划 pop [np.random.permutation(len(targets)) for _ in range(self.pop_size)] for gen in range(100): scores [] for ind in pop: # 计算适应度累计成像收益 - 时间超出惩罚 total_gain 0 t_cur 0 for i in ind: if t_cur time_windows[i][1]: total_gain targets[i][value] t_cur time_windows[i][2] # 观测时长 else: total_gain - 10 scores.append(total_gain) # 选择交叉变异 best_idx np.argmax(scores) best pop[best_idx] # 精英保留 new_pop [best] while len(new_pop) self.pop_size: p1, p2 pop[np.random.choice(len(pop), 2, pnp.exp(scores)/sum(np.exp(scores)))] # 顺序交叉 cut np.random.randint(0, len(targets)) child np.concatenate([p1[:cut], [x for x in p2 if x not in p1[:cut]]]) if np.random.rand() self.mr: # 交换变异 i,j np.random.choice(len(targets), 2, replaceFalse) child[i], child[j] child[j], child[i] new_pop.append(child) pop new_pop self.last_solution best self.last_priorities [t[value] for t in targets] return best