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
8ba09f7e
Commit
8ba09f7e
authored
Jul 10, 2020
by
Elf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改为输入默认周期来计算角速度的方法
parent
9d293a90
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
17 deletions
+20
-17
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/entity/SimData.java
...m/src/main/java/top/ninwoo/weixingsim/entity/SimData.java
+2
-0
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/service/Weixing.java
.../src/main/java/top/ninwoo/weixingsim/service/Weixing.java
+4
-3
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/impl/WeixingImpl.java
.../java/top/ninwoo/weixingsim/service/impl/WeixingImpl.java
+10
-10
apps/cnf-weixingsim/src/test/java/top/ninwoo/WxTests.java
apps/cnf-weixingsim/src/test/java/top/ninwoo/WxTests.java
+3
-3
No files found.
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/entity/SimData.java
View file @
8ba09f7e
...
@@ -10,6 +10,8 @@ public class SimData {
...
@@ -10,6 +10,8 @@ public class SimData {
//时间间隔,默认值为10
//时间间隔,默认值为10
private
int
jiange
=
10
;
private
int
jiange
=
10
;
//周期值,默认值为100分钟,即为6000秒
private
int
zhouqi
=
6000
;
//todo:这里因该预设默认值
//todo:这里因该预设默认值
//星间链路带宽
//星间链路带宽
private
double
bandwidth
=
10
e9
;
private
double
bandwidth
=
10
e9
;
...
...
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/entity/WeiXingData.java
View file @
8ba09f7e
...
@@ -7,7 +7,7 @@ public class WeiXingData {
...
@@ -7,7 +7,7 @@ public class WeiXingData {
//卫星的名字,之后可能作为增删改查的唯一标识
//卫星的名字,之后可能作为增删改查的唯一标识
private
String
name
;
private
String
name
;
//地心距离
//地心距离
private
Float
high
;
private
Float
high
=
(
float
)
780
;
//根据高度计算得出,规定(默认)逆时针为正方向
//根据高度计算得出,规定(默认)逆时针为正方向
private
Double
speed
;
private
Double
speed
;
private
Boolean
tag
=
true
;
private
Boolean
tag
=
true
;
...
...
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/Weixing.java
View file @
8ba09f7e
package
top.ninwoo.weixingsim.service
;
package
top.ninwoo.weixingsim.service
;
import
top.ninwoo.weixingsim.entity.SimData
;
import
top.ninwoo.weixingsim.entity.WeiXingData
;
import
top.ninwoo.weixingsim.entity.WeiXingData
;
import
java.io.File
;
import
java.io.File
;
...
@@ -39,7 +40,7 @@ public interface Weixing {
...
@@ -39,7 +40,7 @@ public interface Weixing {
* @param wx WeiXingData对象
* @param wx WeiXingData对象
* @return
* @return
*/
*/
List
<
WeiXingData
>
add
Speed
(
List
<
WeiXingData
>
wx
);
List
<
WeiXingData
>
add
WSpeed
(
List
<
WeiXingData
>
wx
,
int
zhouqi
);
/**
/**
* @description 根据角度,高度,速度和间隔时间t获取卫星的坐标数据
* @description 根据角度,高度,速度和间隔时间t获取卫星的坐标数据
...
@@ -117,7 +118,7 @@ public interface Weixing {
...
@@ -117,7 +118,7 @@ public interface Weixing {
* @param file 传入文件路径
* @param file 传入文件路径
* @return 返回为卫星List
* @return 返回为卫星List
*/
*/
List
<
WeiXingData
>
iniTopo
(
File
file
)
throws
IllegalAccessException
;
List
<
WeiXingData
>
iniTopo
(
File
file
,
int
zhouqi
)
throws
IllegalAccessException
;
/**
/**
* @description 改变拓扑
* @description 改变拓扑
...
@@ -132,7 +133,7 @@ public interface Weixing {
...
@@ -132,7 +133,7 @@ public interface Weixing {
* @param wxData
* @param wxData
* @return
* @return
*/
*/
List
<
WeiXingData
>
initChangeTopo
(
List
<
WeiXingData
>
wxData
);
List
<
WeiXingData
>
initChangeTopo
(
List
<
WeiXingData
>
wxData
,
int
zhouqi
);
}
}
apps/cnf-weixingsim/src/main/java/top/ninwoo/weixingsim/service/impl/WeixingImpl.java
View file @
8ba09f7e
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
;
...
@@ -14,9 +15,8 @@ import java.util.List;
...
@@ -14,9 +15,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
public
class
WeixingImpl
implements
Weixing
{
public
class
WeixingImpl
implements
Weixing
{
private
static
double
G
=
6.754
*
Math
.
pow
(
10
,-
11
);
private
static
double
EARTHMASS
=
5.965
*
Math
.
pow
(
10
,
24
);
SimData
simData
=
new
SimData
();
private
static
double
GM
=
G
*
EARTHMASS
;
@Override
@Override
public
List
<
Map
>
parseTxt
(
File
file
)
{
public
List
<
Map
>
parseTxt
(
File
file
)
{
...
@@ -77,11 +77,11 @@ public class WeixingImpl implements Weixing {
...
@@ -77,11 +77,11 @@ public class WeixingImpl implements Weixing {
}
}
@Override
@Override
public
List
<
WeiXingData
>
add
Speed
(
List
<
WeiXingData
>
wx
)
{
public
List
<
WeiXingData
>
add
WSpeed
(
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
(
Math
.
sqrt
(
GM
/
Math
.
pow
(
wx
.
get
(
i
).
getHigh
(),
2
)
));}
wx
.
get
(
i
).
setSpeed
(
2
*
Math
.
PI
*(
1
/
zhouqi
));}
else
{
wx
.
get
(
i
).
setSpeed
((-
1
)*
Math
.
sqrt
(
GM
/
Math
.
pow
(
wx
.
get
(
i
).
getHigh
(),
2
)
));}
else
{
wx
.
get
(
i
).
setSpeed
((-
1
)*
2
*
Math
.
PI
*(
1
/
zhouqi
));}
}
}
return
wx
;
return
wx
;
}
}
...
@@ -212,10 +212,10 @@ public class WeixingImpl implements Weixing {
...
@@ -212,10 +212,10 @@ public class WeixingImpl implements Weixing {
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
@Override
public
List
<
WeiXingData
>
iniTopo
(
File
file
)
throws
IllegalAccessException
{
public
List
<
WeiXingData
>
iniTopo
(
File
file
,
int
zhouqi
)
throws
IllegalAccessException
{
List
<
Map
>
maps
=
this
.
parseTxt
(
file
);
List
<
Map
>
maps
=
this
.
parseTxt
(
file
);
List
<
WeiXingData
>
wxData
=
this
.
initNet
(
maps
);
List
<
WeiXingData
>
wxData
=
this
.
initNet
(
maps
);
wxData
=
this
.
initChangeTopo
(
wxData
);
wxData
=
this
.
initChangeTopo
(
wxData
,
zhouqi
);
return
wxData
;
return
wxData
;
}
}
...
@@ -233,8 +233,8 @@ public class WeixingImpl implements Weixing {
...
@@ -233,8 +233,8 @@ public class WeixingImpl implements Weixing {
}
}
@Override
@Override
public
List
<
WeiXingData
>
initChangeTopo
(
List
<
WeiXingData
>
wxData
)
{
public
List
<
WeiXingData
>
initChangeTopo
(
List
<
WeiXingData
>
wxData
,
int
zhouqi
)
{
wxData
=
this
.
add
Speed
(
wxData
);
wxData
=
this
.
add
WSpeed
(
wxData
,
zhouqi
);
wxData
=
this
.
addAxis
(
wxData
);
wxData
=
this
.
addAxis
(
wxData
);
this
.
checkWX
(
wxData
);
this
.
checkWX
(
wxData
);
this
.
addIndex
(
wxData
);
this
.
addIndex
(
wxData
);
...
...
apps/cnf-weixingsim/src/test/java/top/ninwoo/WxTests.java
View file @
8ba09f7e
...
@@ -213,7 +213,7 @@ public class WxTests {
...
@@ -213,7 +213,7 @@ public class WxTests {
SimData
sd
=
new
SimData
();
SimData
sd
=
new
SimData
();
File
file
=
new
File
(
"C:\\WorkSpace\\test\\topusim_1.txt"
);
File
file
=
new
File
(
"C:\\WorkSpace\\test\\topusim_1.txt"
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
,
sd
.
getZhouqi
()
);
int
[][]
toponet
=
tp
.
getTopology
(
wxData
,
sd
);
int
[][]
toponet
=
tp
.
getTopology
(
wxData
,
sd
);
...
@@ -276,7 +276,7 @@ public class WxTests {
...
@@ -276,7 +276,7 @@ public class WxTests {
SimData
sd
=
new
SimData
();
SimData
sd
=
new
SimData
();
//tp.delHistory();
//tp.delHistory();
File
file
=
new
File
(
"C:\\WorkSpace\\test\\topusim_1.txt"
);
File
file
=
new
File
(
"C:\\WorkSpace\\test\\topusim_1.txt"
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
,
sd
.
getZhouqi
()
);
int
[][]
toponet
=
tp
.
getTopology
(
wxData
,
sd
);
int
[][]
toponet
=
tp
.
getTopology
(
wxData
,
sd
);
...
@@ -354,7 +354,7 @@ public class WxTests {
...
@@ -354,7 +354,7 @@ public class WxTests {
SimData
sd
=
new
SimData
();
SimData
sd
=
new
SimData
();
tp
.
delHistory
();
tp
.
delHistory
();
File
file
=
new
File
(
"C:\\WorkSpace\\test\\topusim_1.txt"
);
File
file
=
new
File
(
"C:\\WorkSpace\\test\\topusim_1.txt"
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
);
List
<
WeiXingData
>
wxData
=
wx
.
iniTopo
(
file
,
sd
.
getZhouqi
()
);
int
[][]
toponet
=
tp
.
getTopology
(
wxData
,
sd
);
int
[][]
toponet
=
tp
.
getTopology
(
wxData
,
sd
);
...
...
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