Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-WIC-Cnf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CommunityXG
OpenXG-WIC-Cnf
Commits
8c5f3535
Commit
8c5f3535
authored
Sep 05, 2020
by
Elf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
csv修改
parent
bedba911
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
apps/cnf-path-computing/businessInCloud/src/main/java/top/ninwoo/test/CsvMerge/Wteg.java
...sInCloud/src/main/java/top/ninwoo/test/CsvMerge/Wteg.java
+16
-9
apps/cnf-path-computing/businessInCloud/src/main/java/top/ninwoo/test/doMap/DoMap.java
...essInCloud/src/main/java/top/ninwoo/test/doMap/DoMap.java
+7
-5
No files found.
apps/cnf-path-computing/businessInCloud/src/main/java/top/ninwoo/test/CsvMerge/Wteg.java
View file @
8c5f3535
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 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);
...
...
apps/cnf-path-computing/businessInCloud/src/main/java/top/ninwoo/test/doMap/DoMap.java
View file @
8c5f3535
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment