Commit 3c6c46d5 authored by Hu Jintao's avatar Hu Jintao

调整参数

parent 8f16ab39
...@@ -54,6 +54,11 @@ public class BisheTestMain implements ApplicationRunner { ...@@ -54,6 +54,11 @@ public class BisheTestMain implements ApplicationRunner {
System.out.println(); System.out.println();
// 输入:
//子任务依赖关系 边
int[][] link = {{0, 0, 1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 5, 6}};
//task编号
int[] func = {1, 3, 3, 3, 2, 2, 4};
DoMap doMap = new DoMap(); DoMap doMap = new DoMap();
doMap.doMapApp(); doMap.doMapApp();
...@@ -69,6 +74,36 @@ public class BisheTestMain implements ApplicationRunner { ...@@ -69,6 +74,36 @@ public class BisheTestMain implements ApplicationRunner {
) { ) {
sequence.add(a); sequence.add(a);
} }
//边映射结果T2
int[][] edgeMaps = new int[2][link[0].length];
edgeMaps[0][0] = 2;
for (int tm = 0;tm<link[0].length;tm++){
//第一列为边起点,第二列为边终点
edgeMaps[0][tm] = result[link[0][tm]];
edgeMaps[1][tm] = result[link[1][tm]];
}
//节点映射结果T1
HashMap<Integer,Integer> nodeMaps = new HashMap();
nodeMaps.put(1,func[0]);
for (int tm = 0;tm<link[0].length;tm++){
if (!nodeMaps.containsKey(result[link[1][tm]])){
//key值为节点映射卫星编号,value值为图像处理功能编号
nodeMaps.put(result[link[1][tm]],func[link[1][tm]]);
}
}
int [][] lastHop = doMap.lastHop;
//将路由结果保存 //将路由结果保存
Stack[] route = doMap.route; Stack[] route = doMap.route;
int routeNumber = 0; int routeNumber = 0;
......
...@@ -87,6 +87,8 @@ public class DoMap { ...@@ -87,6 +87,8 @@ public class DoMap {
public static long startT; public static long startT;
//传输时延约束 //传输时延约束
public static LinkedList<Double> list = new LinkedList<>(); public static LinkedList<Double> list = new LinkedList<>();
//路由表
public static int[][] lastHop;
public static void doMapApp() { public static void doMapApp() {
...@@ -142,7 +144,7 @@ public class DoMap { ...@@ -142,7 +144,7 @@ public class DoMap {
route[i] = new Stack<Integer>(); route[i] = new Stack<Integer>();
} }
//3根据分配结果,回溯每一条路由 //3根据分配结果,回溯每一条路由
int[][] lastHop = pathRecord.lastHop; lastHop = pathRecord.lastHop;
for (int i = 0;i<link[0].length;i++){ for (int i = 0;i<link[0].length;i++){
int start = best_par.taskfinal[link[0][i]]; int start = best_par.taskfinal[link[0][i]];
int end = best_par.taskfinal[link[1][i]]; int end = best_par.taskfinal[link[1][i]];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment