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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
alex037yang
openXG-WIC-Cnf
Commits
8143f174
Commit
8143f174
authored
Aug 11, 2020
by
Elf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改好bug,可见test/Parsetest/test1
parent
462fc42f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
8 deletions
+65
-8
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/entity/WeiXingData.java
...c/main/java/top/ninwoo/weixingsim/entity/WeiXingData.java
+1
-1
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/init/Initapp.java
...sim/src/main/java/top/ninwoo/weixingsim/init/Initapp.java
+1
-1
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/impl/ToponetImpl.java
.../java/top/ninwoo/weixingsim/service/impl/ToponetImpl.java
+1
-1
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/impl/WeixingImpl.java
.../java/top/ninwoo/weixingsim/service/impl/WeixingImpl.java
+3
-5
apps/cnf-weixingsim/src/test/java/top/ninwoo/ParseTests.java
apps/cnf-weixingsim/src/test/java/top/ninwoo/ParseTests.java
+59
-0
No files found.
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/entity/WeiXingData.java
View file @
8143f174
...
@@ -22,7 +22,7 @@ public class WeiXingData {
...
@@ -22,7 +22,7 @@ public class WeiXingData {
//卫星的序列号
//卫星的序列号
private
Integer
index
;
private
Integer
index
;
//运行时间
//运行时间
private
Integer
lastime
=
0
;
private
int
lastime
=
0
;
@Override
@Override
public
String
toString
(){
public
String
toString
(){
...
...
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/init/Initapp.java
View file @
8143f174
...
@@ -15,7 +15,7 @@ import java.text.SimpleDateFormat;
...
@@ -15,7 +15,7 @@ import java.text.SimpleDateFormat;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Component
public
class
Initapp
implements
CommandLineRunner
{
public
class
Initapp
implements
CommandLineRunner
{
@Autowired
@Autowired
...
...
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/impl/ToponetImpl.java
View file @
8143f174
...
@@ -61,7 +61,7 @@ public class ToponetImpl implements Toponet {
...
@@ -61,7 +61,7 @@ public class ToponetImpl implements Toponet {
double
r
=
this
.
distance
(
a
,
b
);
double
r
=
this
.
distance
(
a
,
b
);
double
channelCapacity
;
double
channelCapacity
;
channelCapacity
=
sd
.
getBandwidth
()*
Math
.
log
(
1
+(
sd
.
ptGtGr
()/(
Math
.
pow
(
4
*
Math
.
PI
*
r
*
sd
.
getJiange
()
/
sd
.
getLamda
(),
2
)*
sd
.
n0B
())))/
Math
.
log
(
2
);
channelCapacity
=
sd
.
getBandwidth
()*
Math
.
log
(
1
+(
sd
.
ptGtGr
()/(
Math
.
pow
(
4
*
Math
.
PI
*
r
/
sd
.
getLamda
(),
2
)*
sd
.
n0B
())))/
Math
.
log
(
2
);
return
channelCapacity
;
return
channelCapacity
;
}
}
...
...
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/impl/WeixingImpl.java
View file @
8143f174
package
top.ninwoo.weixingsim.service.impl
;
package
top.ninwoo.weixingsim.service.impl
;
import
top.ninwoo.weixingsim.entity.SimData
;
import
top.ninwoo.weixingsim.entity.WeiXingData
;
import
top.ninwoo.weixingsim.entity.WeiXingData
;
import
top.ninwoo.weixingsim.service.Weixing
;
import
top.ninwoo.weixingsim.service.Weixing
;
...
@@ -16,8 +15,6 @@ import java.util.Map;
...
@@ -16,8 +15,6 @@ import java.util.Map;
public
class
WeixingImpl
implements
Weixing
{
public
class
WeixingImpl
implements
Weixing
{
SimData
simData
=
new
SimData
();
@Override
@Override
public
List
<
Map
>
parseTxt
(
File
file
)
{
public
List
<
Map
>
parseTxt
(
File
file
)
{
String
str
;
String
str
;
...
@@ -80,7 +77,8 @@ public class WeixingImpl implements Weixing {
...
@@ -80,7 +77,8 @@ public class WeixingImpl implements Weixing {
public
List
<
WeiXingData
>
addWSpeed
(
List
<
WeiXingData
>
wx
,
int
zhouqi
)
{
public
List
<
WeiXingData
>
addWSpeed
(
List
<
WeiXingData
>
wx
,
int
zhouqi
)
{
for
(
int
i
=
0
;
i
<
wx
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
wx
.
size
();
i
++){
if
(
wx
.
get
(
i
).
getTag
().
equals
(
true
)){
if
(
wx
.
get
(
i
).
getTag
().
equals
(
true
)){
wx
.
get
(
i
).
setSpeed
(
2
*
Math
.
PI
*(
1
/
zhouqi
));}
Double
speed
=
2
*
Math
.
PI
/
zhouqi
;
wx
.
get
(
i
).
setSpeed
(
speed
);}
else
{
wx
.
get
(
i
).
setSpeed
((-
1
)*
2
*
Math
.
PI
*(
1
/
zhouqi
));}
else
{
wx
.
get
(
i
).
setSpeed
((-
1
)*
2
*
Math
.
PI
*(
1
/
zhouqi
));}
}
}
return
wx
;
return
wx
;
...
@@ -90,7 +88,7 @@ public class WeixingImpl implements Weixing {
...
@@ -90,7 +88,7 @@ public class WeixingImpl implements Weixing {
public
List
<
WeiXingData
>
addAxis
(
List
<
WeiXingData
>
wx
)
{
public
List
<
WeiXingData
>
addAxis
(
List
<
WeiXingData
>
wx
)
{
for
(
int
i
=
0
;
i
<
wx
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
wx
.
size
();
i
++)
{
Float
High
=
wx
.
get
(
i
).
getHigh
();
Float
High
=
wx
.
get
(
i
).
getHigh
();
Double
hudu
=
Math
.
toRadians
(
wx
.
get
(
i
).
getSpeed
()
*
wx
.
get
(
i
).
getLastime
()
);
Double
hudu
=
wx
.
get
(
i
).
getSpeed
()
*
wx
.
get
(
i
).
getLastime
(
);
Double
Alpha
=
Math
.
toRadians
(
wx
.
get
(
i
).
getAlpha
());
Double
Alpha
=
Math
.
toRadians
(
wx
.
get
(
i
).
getAlpha
());
Double
Beta
=
Math
.
toRadians
(
wx
.
get
(
i
).
getBeta
());
Double
Beta
=
Math
.
toRadians
(
wx
.
get
(
i
).
getBeta
());
Double
Gamma
=
Math
.
toRadians
(
wx
.
get
(
i
).
getGamma
());
Double
Gamma
=
Math
.
toRadians
(
wx
.
get
(
i
).
getGamma
());
...
...
apps/cnf-weixingsim/src/test/java/top/ninwoo/ParseTests.java
0 → 100644
View file @
8143f174
package
top.ninwoo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
top.ninwoo.weixingsim.WxMain
;
import
top.ninwoo.weixingsim.entity.SimData
;
import
top.ninwoo.weixingsim.entity.WeiXingData
;
import
top.ninwoo.weixingsim.service.impl.ToponetImpl
;
import
top.ninwoo.weixingsim.service.impl.WeixingImpl
;
import
java.io.File
;
import
java.util.List
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
WxMain
.
class
)
public
class
ParseTests
{
@Test
public
void
test1
()
throws
IllegalAccessException
{
//从文本中获取卫星的数据
WeixingImpl
wx
=
new
WeixingImpl
();
ToponetImpl
tp
=
new
ToponetImpl
();
SimData
sd
=
new
SimData
();
//tp.delHistory();
File
file
=
new
File
(
"C:\\WorkSpace\\TXT\\topusim_1.txt"
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
,
sd
.
getZhouqi
());
/*int[][] topoInit = tp.getTopology(wxData,sd);
//输出topo
for(int j = 0;j<topoInit.length;j++){
for(int k= 0;k<topoInit[0].length;k++){
System.out.print(topoInit[j][k] + " ");
}
System.out.println(" ");
} */
sd
.
setJiange
(
60
);
sd
.
setC0
(
3
e10
);
out:
for
(
int
i
=
0
;
i
<
sd
.
getZhouqi
()/
sd
.
getJiange
();
i
++)
{
//Thread.sleep(2000);
int
time
=
i
*
sd
.
getJiange
();
List
<
WeiXingData
>
changetp
=
wx
.
changeTopo
(
wxData
,
time
);
int
[][]
topoChange
=
tp
.
getTopology
(
changetp
,
sd
);
//输出topo
for
(
int
m
=
0
;
m
<
topoChange
.
length
;
m
++){
for
(
int
n
=
0
;
n
<
topoChange
[
0
].
length
;
n
++){
System
.
out
.
print
(
topoChange
[
m
][
n
]
+
" "
);
}
System
.
out
.
println
(
" "
);
}
}
System
.
out
.
println
(
"所有topo完成"
);
}
}
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