Commit 8c5f3535 authored by Elf's avatar Elf

csv修改

parent bedba911
package top.ninwoo.test.CsvMerge;
import top.ninwoo.test.doMap.DoMap;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import static top.ninwoo.test.CsvMerge.GetTopo.TopoRequire;
......@@ -15,25 +14,33 @@ public class Wteg {
* 先用SimpleDateFormat.parse() 方法将日期字符串转化为Date格式
* 通过Date.getTime()方法,将其转化为毫秒数
*/
public static double[][] getWteg() {
public static double[][] getWteg() throws ParseException {
//传输时间参数
String str;
String str1;
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);
str1 = ReadFile.date+" 5-00-20";
int[][] topo1 = TopoRequire(str1);
str2 = ReadFile.date+" 5-00-40";
int[][] topo2 = TopoRequire(str2);
//动态获取当前时间topo
/* Date current = new Date();
/* Date current = new Date();
Date current1 = new Date(current.getTime()+ (long)DoMap.slot);
Date current2 = new Date(current1.getTime()+ (long)DoMap.slot);
SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd HH-mm-ss");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
str = sdf.format(current);
str1 = sdf.format(current1);
str2 = sdf.format(current2);
......
package top.ninwoo.test.doMap;
import org.springframework.beans.factory.annotation.Value;
import top.ninwoo.test.CsvMerge.Wteg;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Random;
import java.util.Stack;
import static top.ninwoo.test.doMap.CycleTopo.cycleTp;
......@@ -16,8 +20,6 @@ import static top.ninwoo.test.doMap.CycleTopo.cycleTp;
* @jthu
*/
public class DoMap {
//最大权值
public static final int MAXWEIGHT = 10000*1000;
......@@ -79,7 +81,7 @@ public class DoMap {
//惯性权重,加速因子1,2
static double s = 1.5; static int c1 = 1; static int c2 = 1;
public static void main(String[] args) {
public static void main(String[] args) throws ParseException {
//子任务依赖关系 边
int[][] link = {{0, 0, 1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 5, 6}};
//task编号
......@@ -99,7 +101,7 @@ public class DoMap {
//路由表
public static int[][] lastHop;
public static void doMapApp(int[][] link1, int[] func1) {
public static void doMapApp(int[][] link1, int[] func1) throws ParseException {
link = link1;
func = func1;
......
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