Commit 61a8238b authored by ymwang's avatar ymwang

csv终版

parent ccc0b961
...@@ -51,13 +51,13 @@ public class Application implements ApplicationRunner { ...@@ -51,13 +51,13 @@ public class Application implements ApplicationRunner {
Object object = objectInputStream.readObject(); Object object = objectInputStream.readObject();
//收到数据包 //收到数据包
DataPackage dataPackage = (DataPackage) object; DataPackage dataPackage = (DataPackage) object;
System.out.println("receive"); System.out.println("received");
//构建新的数据包 //构建新的数据包
DataPackage newDataPackage = dataPackage; DataPackage newDataPackage = dataPackage;
//得到本机路由表 //得到本机路由表
String[] route = findService.findRoute(dataPackage.getCurrentSataHop(), dataPackage.getRoute()); String[] route = findService.findRoute(dataPackage.getCurrentSataHop(), dataPackage.getRoute());
System.out.println(Arrays.toString(route)); // System.out.println(Arrays.toString(route));
System.out.println("========================"); System.out.println("======next hop======");
//判断是否为该边的终点,如果是,进行函数计算并创建一个新的数据包,转发 //判断是否为该边的终点,如果是,进行函数计算并创建一个新的数据包,转发
if (dataPackage.getCurrentSataHop().equals(dataPackage.getDestinSataHop())) { if (dataPackage.getCurrentSataHop().equals(dataPackage.getDestinSataHop())) {
LinkedList<Picture> picPara = new LinkedList<>(); LinkedList<Picture> picPara = new LinkedList<>();
......
...@@ -62,7 +62,7 @@ public class FindServiceImpl implements FindService { ...@@ -62,7 +62,7 @@ public class FindServiceImpl implements FindService {
//找到本卫星的路由 //找到本卫星的路由
private String[] findCurrentRoute(String sataname, String[][] routeTable){ private String[] findCurrentRoute(String sataname, String[][] routeTable){
int index = Integer.parseInt(sataname.split("sate")[1]); int index = Integer.parseInt(sataname.split("sate")[1]);
System.out.println(index); // System.out.println(index);
return routeTable[index-1]; return routeTable[index-1];
} }
} }
......
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