论文《面向时间敏感网络的时间触发流多路径路由和调度研究》的python实现,ILP通过gurobipy库实现
步骤4的随机游走实现过程:
①判断所有蚂蚁ants与蚁狮$antlion_i$(其中一只蚂蚁$ant_i$对应,步骤3实现)是否有相交NRSs,如果有的话,则指定该蚂蚁为对应蚁狮的周围蚂蚁
②蚂蚁在蚁狮周边的随机游走过程定义为其与蚁狮进行路径交换的过程,将周围蚂蚁的游走(即路径交换)过程记录下来
③如果有周围蚂蚁的游走记录,根据所有记录更新$ant_i$的路径;如果没有周围蚂蚁的游走记录,那么$ant_i$的每一组NRS按照随机概率与对应的蚁狮$antlion_i$对应的NRS交换
将避免竞争约束(Contention-free Constraints)【论文公式4.6、4.7】结合其对应的二元互斥变量,转化为如下公式: