Commit 35fefb35 authored by Elf's avatar Elf

csv修改

parent fb743ae8
...@@ -3,6 +3,7 @@ package top.ninwoo.test.CsvMerge; ...@@ -3,6 +3,7 @@ package top.ninwoo.test.CsvMerge;
import top.ninwoo.test.doMap.DoMap; import top.ninwoo.test.doMap.DoMap;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -15,33 +16,39 @@ public class Wteg { ...@@ -15,33 +16,39 @@ public class Wteg {
* 先用SimpleDateFormat.parse() 方法将日期字符串转化为Date格式 * 先用SimpleDateFormat.parse() 方法将日期字符串转化为Date格式
* 通过Date.getTime()方法,将其转化为毫秒数 * 通过Date.getTime()方法,将其转化为毫秒数
*/ */
public static double[][] getWteg() { public static double[][] getWteg() throws ParseException {
//传输时间参数 //传输时间参数
String str; String str;
String str1; String str1;
String str2; String str2;
//可在这里修改时间
//todo 应该放在yaml文件中
String dateInput = "5-00-00";
long time;
//测试时间 //测试时间
/*str = ReadFile.date+" 5-00-00"; str = ReadFile.date+" "+ dateInput;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
Date current1 = new Date(sdf.parse(str).getTime()+ (long)DoMap.slot);
Date current2 = new Date(current1.getTime()+ (long)DoMap.slot);
//
str1 = sdf.format(current1);
str2 = sdf.format(current2);
//产生三个时隙
int[][] topo = TopoRequire(str); int[][] topo = TopoRequire(str);
str1 = ReadFile.date+" 5-00-20";
int[][] topo1 = TopoRequire(str1); int[][] topo1 = TopoRequire(str1);
str2 = ReadFile.date+" 5-00-40"; int[][] topo2 = TopoRequire(str2);
int[][] topo2 = TopoRequire(str2);*/
//动态获取当前时间topo //动态获取当前时间topo
Date current = new Date(); /* Date current = new Date();
Date current1 = new Date(current.getTime()+ (long)DoMap.slot); Date current1 = new Date(current.getTime()+ (long)DoMap.slot);
Date current2 = new Date(current1.getTime()+ (long)DoMap.slot); Date current2 = new Date(current1.getTime()+ (long)DoMap.slot);
SimpleDateFormat sdf = new SimpleDateFormat( SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
"yyyy-MM-dd HH-mm-ss");
str = sdf.format(current); str = sdf.format(current);
str1 = sdf.format(current1); str1 = sdf.format(current1);
str2 = sdf.format(current2); str2 = sdf.format(current2);
int[][] topo = TopoRequire(str); int[][] topo = TopoRequire(str);
int[][] topo1 = TopoRequire(str1); int[][] topo1 = TopoRequire(str1);
int[][] topo2 = TopoRequire(str2); int[][] topo2 = TopoRequire(str2);*/
//获得单时隙连接矩阵 0或MAXWEIGHT //获得单时隙连接矩阵 0或MAXWEIGHT
//等待下一时隙开始执行业务 //等待下一时隙开始执行业务
......
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