5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/StarPerf.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | StarPerf 2.0
4 |
5 | Python version requirements : Python 3.10
6 |
7 | Added implementation of security simulation
8 |
9 | """
10 |
11 | def main():
12 | print("Starting StarPerf...")
13 |
14 |
15 | print("Starting XML Constellations Testing...")
16 | # test the core module functionality of various XML constellations
17 | import samples.XML_constellation.XML_constellation_test_cases
18 | samples.XML_constellation.XML_constellation_test_cases.XML_constellation_test_cases()
19 | print("END.")
20 |
21 | print("Starting TLE Constellations Testing")
22 | # test the core module functionality of various TLE constellations
23 | import samples.TLE_constellation.TLE_constellation_test_cases
24 | samples.TLE_constellation.TLE_constellation_test_cases.TLE_constellation_test_cases()
25 | print("END.")
26 |
27 | print("Starting Standalone Module Testing...")
28 | # test each standalone module under "src/standalone_module/" in starperf 2.0
29 | import samples.standalone_module.standalone_module_test_cases as standalone_module_test_cases
30 | standalone_module_test_cases.standalone_module_test_cases()
31 | print("END.")
32 |
33 | print("Starting Tool Scripts Testing...")
34 | # test each tool script under "kits/" in starperf 2.0
35 | import samples.kits.kits_test_cases as KITS_TEST_CASES
36 | KITS_TEST_CASES.kits_test_cases()
37 | print("END.")
38 |
39 | """
40 | This will test the functionality of duration constellation. It is similar to the previously
41 | implemented XML Constellation, but supports customizing the simulation time and simulation
42 | sampling interval (XML Constellation currently only supports simulation of the entire orbital period)
43 | """
44 | print("Start simulation performance and indicators testing")
45 | import samples.duration_constellation.duration_constellation_cases
46 | samples.duration_constellation.duration_constellation_cases.constellation_performance()
47 | print("END.")
48 |
49 | """
50 | This will take the longest time. On a 4-core Intel Xeon Processor (Icelake) processor,
51 | 1 second of traffic will be generated every 15 seconds. Therefore, the traffic generation
52 | here is set to 10 seconds, although I generated 1000 seconds of traffic in the experiment.
53 | """
54 | print("Start benign traffic generation")
55 | import samples.traffic.traffic_generation_cases
56 | samples.traffic.traffic_generation_cases.traffic_generation()
57 | print("END.")
58 |
59 | """
60 | Energy consumption attacks require longer traffic generation time, because the implementation
61 | period of the attack is usually measured in months and years. In the example here, I only
62 | implemented a simulation of dT=500 for one orbital period, which requires 11s of traffic generation.
63 | """
64 | print("Start LEO network security simulation")
65 | import samples.attack.attack_cases
66 | samples.attack.attack_cases.attack_cases()
67 | print("END.")
68 |
69 |
70 |
71 | if __name__ == '__main__':
72 | import samples.standalone_module.standalone_module_test_cases as standalone_module_test_cases
73 |
74 | standalone_module_test_cases.standalone_module_test_cases()
75 |
--------------------------------------------------------------------------------
/config/POPs/Starlink.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 47.6048790423666
4 | -122.333542912036
5 | SEA - STTLWAX1
6 |
7 |
8 | 41.8818060511642
9 | -87.6241606221099
10 | ORD/CHI - CHCOILX1
11 |
12 |
13 | 39.7404600071268
14 | -104.989827109128
15 | DEN - DNVRCOX1
16 |
17 |
18 | 34.0648585651784
19 | -118.246250945102
20 | LAX - LSANCAX1
21 |
22 |
23 | 40.7053809687342
24 | -73.9805569966953
25 | LGA/NYC - NWYYNYX1
26 |
27 |
28 | 33.8537637086147
29 | -84.3863990704516
30 | ATL - ATLAGAX1
31 |
32 |
33 | 32.9314754595072
34 | -96.7973844644494
35 | DFW/DAL - DLLSTXX1
36 |
37 |
38 | 20.5780242985263
39 | -100.253545274656
40 | QRO/MEX - QRTOMEX1
41 |
42 |
43 | -33.8626309526837
44 | 151.205196681751
45 | SYD - SYDYAUS1
46 |
47 |
48 | -23.5474263016486
49 | -46.6434354904817
50 | GRU - SPLOBRA1
51 |
52 |
53 | -33.4288103351528
54 | -70.6724666543217
55 | SCL - SNTOCHL1
56 |
57 |
58 | 50.1180135096041
59 | 8.68324256215514
60 | FRA - FRNTDEU1
61 |
62 |
63 | 35.7832975191432
64 | 139.77424808807
65 | TYO/NRT - TKYOJPN1
66 |
67 |
68 | 6.46845378501768
69 | 3.57996575617339
70 | LOS - LGOSNGA1
71 |
72 |
73 | 40.4232025529521
74 | -3.70358472507101
75 | MAD - MDRDESP1
76 |
77 |
78 | 51.5269952019059
79 | -0.0203747388462674
80 | LON/LHR - LNDNGBR1
81 |
82 |
83 | 4.66104048598056
84 | -74.1396929264864
85 | BOG - BGTACOL1
86 |
87 |
88 | -36.8307052006784
89 | 174.746900452669
90 | AKL - AKLNZL1
91 |
92 |
93 | -12.0561556281692
94 | -76.9579303770631
95 | LIM - LIMAPER1
96 |
97 |
98 | -31.9526735550577
99 | 115.865844303011
100 | PER - PRTHAU1
101 |
102 |
103 | 14.5536964111545
104 | 121.024139985734
105 | MNL - MNLAPH1
106 |
107 |
108 | -6.2093718794717
109 | 106.858420399263
110 | CGK - JTNAIDN1
111 |
112 |
113 | 1.33479356735098
114 | 103.957706909928
115 | SIN - SNGESGP1
116 |
117 |
118 |
--------------------------------------------------------------------------------
/config/TLE_constellation/Starlink/tle.h5:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1a31b6acc7a13e6ec81204d8a786885d023049eb6c0c775ac0ca0b850c6c24fd
3 | size 62683520
4 |
--------------------------------------------------------------------------------
/config/XML_constellation/Boeing.xml:
--------------------------------------------------------------------------------
1 |
2 | 2
3 |
4 | 1056
5 | 6370
6 | 54
7 | 0
8 | 11
9 | 12
10 |
11 |
12 | 35786
13 | 86142
14 | 53.4
15 | 0
16 | 5
17 | 3
18 |
19 |
--------------------------------------------------------------------------------
/config/XML_constellation/Kuiper.xml:
--------------------------------------------------------------------------------
1 |
2 | 3
3 |
4 | 630
5 | 5830
6 | 51.9
7 | 0
8 | 34
9 | 34
10 |
11 |
12 | 610
13 | 5805
14 | 42
15 | 0
16 | 36
17 | 36
18 |
19 |
20 | 590
21 | 5780
22 | 33
23 | 0
24 | 28
25 | 28
26 |
27 |
--------------------------------------------------------------------------------
/config/XML_constellation/OneWeb.xml:
--------------------------------------------------------------------------------
1 |
2 | 1
3 |
4 | 1200
5 | 6556
6 | 87.9
7 | 0
8 | 12
9 | 49
10 |
11 |
--------------------------------------------------------------------------------
/config/XML_constellation/Polar.xml:
--------------------------------------------------------------------------------
1 |
2 | 1
3 |
4 | 1200
5 | 5792
6 | 90
7 | 0
8 | 15
9 | 15
10 |
11 |
--------------------------------------------------------------------------------
/config/XML_constellation/Starlink.xml:
--------------------------------------------------------------------------------
1 |
2 | 4
3 |
4 | 550
5 | 5731
6 | 53.0
7 | 1
8 | 72
9 | 22
10 |
11 |
12 | 570
13 | 5755
14 | 70
15 | 1
16 | 36
17 | 20
18 |
19 |
20 | 560
21 | 5743
22 | 97.6
23 | 1
24 | 10
25 | 52
26 |
27 |
28 | 540
29 | 5718
30 | 53.2
31 | 1
32 | 72
33 | 22
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/config/XML_constellation/Telesat.xml:
--------------------------------------------------------------------------------
1 |
2 | 2
3 |
4 | 1015
5 | 6557
6 | 98.98
7 | 0
8 | 27
9 | 13
10 |
11 |
12 | 1325
13 | 6298
14 | 50.88
15 | 0
16 | 40
17 | 33
18 |
19 |
--------------------------------------------------------------------------------
/data/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/data/.DS_Store
--------------------------------------------------------------------------------
/data/XML_constellation/Boeing.h5:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a0ce2dc384212a9dfae14d278c1225921eef7636eaaba8618588b790d1ede28e
3 | size 162928
4 |
--------------------------------------------------------------------------------
/data/XML_constellation/Kuiper.h5:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a8095ce5f765d67f5423f86015ca2f57ea85d4de28f44ccee46b5f982b953b82
3 | size 1130032
4 |
--------------------------------------------------------------------------------
/data/XML_constellation/OneWeb.h5:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:471a6a0384f1ba5eb48484ff86526c0fa6be4f9084ee049882e8972faf1763c7
3 | size 730864
4 |
--------------------------------------------------------------------------------
/data/h3_cells_id_res0-4.h5:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b1c920aa87628a47ebc7c704014afbf19eb286dd5b5b770bb080078856b1ad95
3 | size 16166944
4 |
--------------------------------------------------------------------------------
/docs/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/.DS_Store
--------------------------------------------------------------------------------
/docs/TLEconstellation_generation_test_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/TLEconstellation_generation_test_result.png
--------------------------------------------------------------------------------
/docs/XMLconstellation_generation_test_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/XMLconstellation_generation_test_result.png
--------------------------------------------------------------------------------
/docs/beam_random_placement_execution_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/beam_random_placement_execution_result.png
--------------------------------------------------------------------------------
/docs/config_module_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/config_module_architecture.png
--------------------------------------------------------------------------------
/docs/h5_file_introduction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/h5_file_introduction.png
--------------------------------------------------------------------------------
/docs/h5_file_tree_structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/h5_file_tree_structure.png
--------------------------------------------------------------------------------
/docs/input_orbit_number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/input_orbit_number.png
--------------------------------------------------------------------------------
/docs/interface_convention.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/interface_convention.pdf
--------------------------------------------------------------------------------
/docs/kernel_module_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/kernel_module_architecture.png
--------------------------------------------------------------------------------
/docs/level_1_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/level_1_architecture.png
--------------------------------------------------------------------------------
/docs/new_kernel_arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/new_kernel_arch.png
--------------------------------------------------------------------------------
/docs/raan_distribution.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/raan_distribution.png
--------------------------------------------------------------------------------
/docs/satellite_visibility_time.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/satellite_visibility_time.png
--------------------------------------------------------------------------------
/docs/satellite_visibility_time_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/satellite_visibility_time_result.png
--------------------------------------------------------------------------------
/docs/starperfpy_execute_information.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/starperfpy_execute_information.png
--------------------------------------------------------------------------------
/docs/third-party_libraries_list.txt:
--------------------------------------------------------------------------------
1 | h3==4.0.0b2
2 | h5py==3.10.0
3 | numpy==1.24.4
4 | openpyxl==3.1.2
5 | importlib-metadata==6.8.0
6 | skyfield==1.46
7 | sgp4==2.22
8 | pandas==2.1.0
9 | poliastro==0.17.0
10 | astropy==5.3.3
11 | networkx==3.1
12 | requests==2.31.0
13 | jenkspy==0.4.0
14 | pyecharts==2.0.4
15 | global_land_mask==1.0.0
--------------------------------------------------------------------------------
/docs/tle_download_success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/tle_download_success.png
--------------------------------------------------------------------------------
/docs/tle_tree_structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/tle_tree_structure.png
--------------------------------------------------------------------------------
/docs/view_h3_cells_h3id.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/docs/view_h3_cells_h3id.png
--------------------------------------------------------------------------------
/kits/download_today_TLE_data.py:
--------------------------------------------------------------------------------
1 | '''
2 | Author : yunanhou
3 |
4 | Date : 2023/11/26
5 |
6 | Function : Download the current day's TLE data from the CelesTrak website
7 | https://celestrak.org/NORAD/elements/index.php?FORMAT=2le
8 |
9 | Note: Note: These two download TLE data in two formats: 2LE and JSON.
10 | The standard TLE data format is as follows:
11 |
12 | STARLINK-1007
13 | 1 44713U 19074A 23329.35222268 .00001777 00000+0 13823-3 0 9990
14 | 2 44713 53.0554 336.5953 0001540 82.5266 277.5898 15.06386495222847
15 |
16 | The 2LE format omits the first line of standard TLE data and only retains the second and third lines, as follows:
17 |
18 | 1 44713U 19074A 23329.35222268 .00001777 00000+0 13823-3 0 9990
19 | 2 44713 53.0554 336.5953 0001540 82.5266 277.5898 15.06386495222847
20 |
21 | JSON format is the data after parsing standard TLE data into JSON format, as follows:
22 |
23 | [
24 | {
25 | "OBJECT_NAME": "STARLINK-1007",
26 | "OBJECT_ID": "2019-074A",
27 | "EPOCH": "2023-11-25T08:27:12.039552",
28 | "MEAN_MOTION": 15.06386495,
29 | "ECCENTRICITY": 0.000154,
30 | "INCLINATION": 53.0554,
31 | "RA_OF_ASC_NODE": 336.5953,
32 | "ARG_OF_PERICENTER": 82.5266,
33 | "MEAN_ANOMALY": 277.5898,
34 | "EPHEMERIS_TYPE": 0,
35 | "CLASSIFICATION_TYPE": "U",
36 | "NORAD_CAT_ID": 44713,
37 | "ELEMENT_SET_NO": 999,
38 | "REV_AT_EPOCH": 22284,
39 | "BSTAR": 0.00013823,
40 | "MEAN_MOTION_DOT": 1.777e-5,
41 | "MEAN_MOTION_DDOT": 0
42 | },
43 | ...
44 | ]
45 |
46 | Since h5 files cannot directly store data in JSON format, each JSON object needs to be converted into a string
47 | first and then stored in the h5 file. When reading data, the string needs to be converted into JSON before it can
48 | be used.
49 | '''
50 | import requests
51 | import os
52 | import h5py
53 | from datetime import datetime
54 | import json
55 |
56 |
57 | # download the current day's TLE data from the CelesTrak website
58 | def download_today_TLE_data(constellation_name):
59 | # h5 file path to save TLE data
60 | file_path = 'config/TLE_constellation/' + constellation_name + '/tle.h5'
61 | if not os.path.exists(file_path):
62 | with h5py.File(file_path, 'a') as file:
63 | pass
64 | # TLE data url
65 | url1 = "https://celestrak.org/NORAD/elements/gp.php?GROUP=" + constellation_name + "&FORMAT=2le"
66 | url2 = "https://celestrak.org/NORAD/elements/gp.php?GROUP=" + constellation_name + "&FORMAT=json"
67 | try:
68 | # send HTTP GET request
69 | response1 = requests.get(url1)
70 | # check if the request was successful
71 | response1.raise_for_status()
72 | # get web page TLE data and split the str by '\n'
73 | TLE = response1.text.split('\n')
74 | # delete the last row because it is a blank row with no data
75 | TLE.pop()
76 |
77 | response2 = requests.get(url2)
78 | if response2.status_code == 200:
79 | json_TLE = response2.json()
80 | # convert each JSON object to a string
81 | json_TLE = [json.dumps(item) for item in json_TLE]
82 |
83 | with h5py.File(file_path, 'a') as file:
84 | # get the current date and format it into 'yyyymmdd' format
85 | current_date = datetime.now()
86 | formatted_date = current_date.strftime('%Y%m%d')
87 | # if the group named with formatted_date does not exist, create a new group with the name
88 | # formatted_date, and write the obtained TLE data into the group.
89 | if file.get(formatted_date) is None:
90 | file.create_group(formatted_date)
91 | file[formatted_date].create_dataset(formatted_date + "-2LE", data=TLE)
92 | file[formatted_date].create_dataset(formatted_date + "-json", data=json_TLE)
93 | print("\t\t\t" , constellation_name + '\'s TLE data download was successful on ' + formatted_date + ' !')
94 | else:
95 | print('\t\t\tThe TLE data you downloaded already exists!')
96 | except requests.exceptions.RequestException as e:
97 | print(f"\t\t\tWhen downloading TLE data, an error occurred in the web page request: {e}")
--------------------------------------------------------------------------------
/kits/get_h3_all_cells.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/12
6 |
7 | Function : This script is used to obtain the cells at resolution 0-4 of the python h3 library, and save the
8 | h3ids of cells with different resolutions into the same .h5 file. The path of the file is:
9 | data/h3_cells_id_res0-4.h5
10 |
11 | '''
12 | import h3
13 | import h5py
14 |
15 |
16 | def get_h3_all_cells():
17 | # create an hdf5 file (if the file does not exist, it will be created; if it exists, it will be overwritten)
18 | with h5py.File('data/h3_cells_id_res0-4.h5', 'w') as file:
19 | # a list collection composed of h3ids of all cells with resolution 0
20 | res0_cells = list(h3.get_res0_cells())
21 | # write res0_cells to file
22 | file.create_dataset('res0_cells', data=res0_cells)
23 | # a list collection composed of h3ids of all cells with resolution 1
24 | res1_cells = []
25 | for res0_cell in res0_cells:
26 | res1_cells = res1_cells + list(h3.cell_to_children(res0_cell))
27 | # write res1_cells to file
28 | file.create_dataset('res1_cells', data=res1_cells)
29 | # a list collection composed of h3ids of all cells with resolution 2
30 | res2_cells = []
31 | for res1_cell in res1_cells:
32 | res2_cells = res2_cells + list(h3.cell_to_children(res1_cell))
33 | # write res2_cells to file
34 | file.create_dataset('res2_cells', data=res2_cells)
35 | # a list collection composed of h3ids of all cells with resolution 3
36 | res3_cells = []
37 | for res2_cell in res2_cells:
38 | res3_cells = res3_cells + list(h3.cell_to_children(res2_cell))
39 | # write res3_cells to file
40 | file.create_dataset('res3_cells', data=res3_cells)
41 | # a list collection composed of h3ids of all cells with resolution 4
42 | res4_cells = []
43 | for res3_cell in res3_cells:
44 | res4_cells = res4_cells + list(h3.cell_to_children(res3_cell))
45 | # write res4_cells to file
46 | file.create_dataset('res4_cells', data=res4_cells)
--------------------------------------------------------------------------------
/kits/get_h5file_satellite_delay_data.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/13
6 |
7 | Function : read the delay matrix data in the h5 file
8 |
9 | '''
10 | import h5py
11 | import numpy as np
12 |
13 |
14 | def get_h5file_satellite_delay_data():
15 | # read the delay matrix data in the h5 file
16 | with h5py.File('data/XML_constellation/Starlink.h5', 'r') as file:
17 | # access the existing first-level subgroup delay group
18 | delay = file['delay']
19 | # access the existing secondary subgroup 'shell'+str(count) subgroup
20 | current_shell_group = delay['shell1']
21 | # read dataset
22 | delay_matrix = np.array(current_shell_group['timeslot1']).tolist()
23 |
24 | print(delay_matrix)
25 |
26 |
27 | if __name__ == '__main__':
28 | get_h5file_satellite_delay_data()
--------------------------------------------------------------------------------
/kits/get_h5file_satellite_position_data.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/13
6 |
7 | Function : read the position matrix data in the h5 file
8 |
9 | '''
10 | import h5py
11 | import numpy as np
12 |
13 | def get_h5file_satellite_position_data(h5_file_name):
14 | # read the position matrix data in the h5 file
15 | with h5py.File(h5_file_name, 'r') as file:
16 | # access the existing first-level subgroup position group
17 | position = file['position']
18 | # access the existing secondary subgroup 'shell'+str(count) subgroup
19 | current_shell_group = position['shell1']
20 | # read dataset
21 | data = np.array(current_shell_group['timeslot1']).tolist()
22 | data = [element.decode('utf-8') for row in data for element in row]
23 | data = [data[i:i + 3] for i in range(0, len(data), 3)]
24 | data = [[float(element) for element in row] for row in data]
25 |
26 | for ele in data:
27 | print("\t\t\t" , ele)
28 |
29 |
30 | if __name__ == '__main__':
31 | get_h5file_satellite_position_data('../../StarAlliance/GRASP_PR_new/ID_1/Boeing.h5')
--------------------------------------------------------------------------------
/kits/get_h5file_tree_structure.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/12
6 |
7 | Function : recursively read all groups and datasets in the .h5 file to obtain its tree directory structure
8 |
9 | '''
10 | import h5py
11 |
12 |
13 | def print_hdf5_structure(group, indent=0):
14 | for key in group.keys():
15 | item = group[key]
16 | if isinstance(item, h5py.Group):
17 | print("\t\t\t" , " " * indent + f"Group: {key}")
18 | print_hdf5_structure(item, indent + 1)
19 | elif isinstance(item, h5py.Dataset):
20 | print("\t\t\t" , " " * indent + f"Dataset: {key}")
21 |
22 |
23 |
24 | if __name__ == '__main__':
25 | with h5py.File('../data/XML_constellation/Kuiper.h5', 'r') as file:
26 | print_hdf5_structure(file)
--------------------------------------------------------------------------------
/kits/print_h3_cells_h3id.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/21
6 |
7 | Function : This script is used to view the h3id of all cells with the specified resolution in
8 | "data/h3_cells_id_res0-4.h5"
9 |
10 | '''
11 | import h5py
12 | import numpy as np
13 |
14 | # Parameter :
15 | # resolution : the resolution of cells is an integer. Currently, the supported value range is 0/1/2/3/4
16 | def print_h3_cells_h3id(resolution):
17 | with h5py.File('data/h3_cells_id_res0-4.h5', 'r') as file:
18 | cells = np.array(file['res' + str(resolution) + '_cells']).tolist()
19 | for item in cells:
20 | print("\t\t\t" , item)
--------------------------------------------------------------------------------
/kits/transform_StarLink_GSs_from_xlsx_to_xml.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/13
6 |
7 | Function : convert Starlink GS data information from xlsx format to xml format
8 |
9 | '''
10 | import openpyxl
11 | from xml.etree.ElementTree import Element, SubElement, tostring
12 | from xml.dom import minidom
13 |
14 |
15 | def xlsx_to_xml(xlsx_file_path, xml_file_path):
16 | # read the Excel file
17 | workbook = openpyxl.load_workbook(xlsx_file_path)
18 | sheet = workbook.active
19 | # create XML root element
20 | root = Element('GSs')
21 | # get header field name
22 | header_row = list(sheet.iter_rows(min_row=1, max_row=1, values_only=True))[0]
23 | # traverse the data row starting with the second row
24 | for row_index, row in enumerate(sheet.iter_rows(min_row=2, values_only=True), start=1):
25 | gs_element = SubElement(root, f'GS{row_index}')
26 | for index, value in enumerate(row):
27 | field_name = header_row[index]
28 | field = SubElement(gs_element, field_name)
29 | field.text = str(value)
30 | # format using minidom
31 | xml_string = minidom.parseString(tostring(root)).toprettyxml(indent=" ")
32 | # delete the first line
33 | xml_lines = xml_string.split('\n')[1:]
34 | formatted_xml = '\n'.join(xml_lines)
35 | # write to XML file
36 | with open(xml_file_path, 'w' , encoding="utf-8") as xml_file:
37 | xml_file.write(formatted_xml)
38 |
--------------------------------------------------------------------------------
/kits/transform_StarLink_Launches_from_xlsx_to_xml.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/30
6 |
7 | Function : convert Starlink launches data information from xlsx format to xml format
8 |
9 | '''
10 | import openpyxl
11 | from xml.etree.ElementTree import Element, SubElement, tostring
12 | from xml.dom import minidom
13 |
14 |
15 | def xlsx_to_xml(xlsx_file_path, xml_file_path):
16 | # read the Excel file
17 | workbook = openpyxl.load_workbook(xlsx_file_path)
18 | sheet = workbook.active
19 | # create XML root element
20 | root = Element('Launches')
21 | # get header field name
22 | header_row = list(sheet.iter_rows(min_row=1, max_row=1, values_only=True))[0]
23 | # traverse the data row starting with the second row
24 | for row_index, row in enumerate(sheet.iter_rows(min_row=2, values_only=True), start=1):
25 | gs_element = SubElement(root, f'Launch{row_index}')
26 | for index, value in enumerate(row):
27 | field_name = header_row[index]
28 | field = SubElement(gs_element, field_name)
29 | field.text = str(value)
30 | # format using minidom
31 | xml_string = minidom.parseString(tostring(root)).toprettyxml(indent=" ")
32 | # delete the first line
33 | xml_lines = xml_string.split('\n')[1:]
34 | formatted_xml = '\n'.join(xml_lines)
35 | # write to XML file
36 | with open(xml_file_path, 'w' , encoding="utf-8") as xml_file:
37 | xml_file.write(formatted_xml)
--------------------------------------------------------------------------------
/kits/transform_StarLink_POPs_from_xlsx_to_xml.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/14
6 |
7 | Function : convert Starlink POP data information from xlsx format to xml format
8 |
9 | '''
10 |
11 | import openpyxl
12 | from xml.etree.ElementTree import Element, SubElement, tostring
13 | from xml.dom import minidom
14 |
15 |
16 | def xlsx_to_xml(xlsx_file_path, xml_file_path):
17 | # read the Excel file
18 | workbook = openpyxl.load_workbook(xlsx_file_path)
19 | sheet = workbook.active
20 | # create XML root element
21 | root = Element('POPs')
22 | # get header field name
23 | header_row = list(sheet.iter_rows(min_row=1, max_row=1, values_only=True))[0]
24 | # traverse the data row starting with the second row
25 | for row_index, row in enumerate(sheet.iter_rows(min_row=2, values_only=True), start=1):
26 | gs_element = SubElement(root, f'POP{row_index}')
27 | for index, value in enumerate(row):
28 | field_name = header_row[index]
29 | field = SubElement(gs_element, field_name)
30 | field.text = str(value)
31 | # format using minidom
32 | xml_string = minidom.parseString(tostring(root)).toprettyxml(indent=" ")
33 | # delete the first line
34 | xml_lines = xml_string.split('\n')[1:]
35 | formatted_xml = '\n'.join(xml_lines)
36 | # write to XML file
37 | with open(xml_file_path, 'w' , encoding="utf-8") as xml_file:
38 | xml_file.write(formatted_xml)
39 |
--------------------------------------------------------------------------------
/kits/view_constellation_TLE_data.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/26
6 |
7 | Function : This script is used to view the TLE_data data of the constellation.
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.download_TLE_data as DOWNLOAD_TLE_DATA
11 | import h5py
12 | from datetime import datetime
13 | import numpy as np
14 | import json
15 |
16 | def view_constellation_TLE_data(constellation_name):
17 | # download constellation TLE_data data
18 | DOWNLOAD_TLE_DATA.download_TLE_data(constellation_name)
19 | file_path = 'config/TLE_constellation/' + constellation_name + '/tle.h5'
20 | with h5py.File(file_path, 'a') as file:
21 | current_date = datetime.now()
22 | formatted_date = current_date.strftime('%Y%m%d')
23 | TLE_group = file[formatted_date]
24 | TLE_2LE = np.array(TLE_group[formatted_date + '-2LE']).tolist()
25 | TLE_2LE = [item.decode('utf-8') for item in TLE_2LE]
26 | TLE_JSON = np.array(TLE_group[formatted_date + '-json']).tolist()
27 | TLE_JSON = [item.decode('utf-8') for item in TLE_JSON]
28 | # convert string to JSON object
29 | TLE_JSON = [json.loads(item) for item in TLE_JSON]
30 |
31 | print('\t\t\t2LE format TLE data : ')
32 | for tle in TLE_2LE:
33 | print("\t\t\t" , tle)
34 | print('\t\t\tJSON format TLE data : ')
35 | for tle in TLE_JSON:
36 | print("\t\t\t" , tle)
--------------------------------------------------------------------------------
/kits/view_h3id_of_cells.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/25
6 |
7 | Function : View the h3id of h3 cells
8 |
9 |
10 | '''
11 | import h5py
12 | import numpy as np
13 |
14 |
15 | def view_h3id_of_cells():
16 | # read the delay matrix data in the h5 file
17 | with h5py.File('data/h3_cells_id_res0-4.h5', 'r') as file:
18 | # read dataset
19 | res0_cells = np.array(file['res0_cells']).tolist()
20 | print('\t\t\tresolution = 0 cells : ')
21 | print("\t\t\t" , res0_cells)
22 |
23 | print('\t\t\tresolution = 1 cells : ')
24 | res1_cells = np.array(file['res1_cells']).tolist()
25 | print("\t\t\t" , res1_cells)
26 |
27 | print('\t\t\tresolution = 2 cells : ')
28 | res2_cells = np.array(file['res2_cells']).tolist()
29 | print("\t\t\t" , res2_cells)
30 |
31 | print('\t\t\tresolution = 3 cells : ')
32 | res3_cells = np.array(file['res3_cells']).tolist()
33 | print("\t\t\t" , res3_cells)
34 |
35 | print('\t\t\tresolution = 4 cells : ')
36 | res4_cells = np.array(file['res4_cells']).tolist()
37 | print("\t\t\t" , res4_cells)
38 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | h3==4.0.0b2
2 | h5py==3.10.0
3 | numpy==1.24.4
4 | openpyxl==3.1.2
5 | importlib-metadata==6.8.0
6 | skyfield==1.46
7 | sgp4==2.22
8 | pandas==2.1.0
9 | poliastro==0.17.0
10 | astropy==5.3.3
11 | networkx==3.1
12 | requests==2.31.0
13 | jenkspy==0.4.0
14 | pyecharts==2.0.4
--------------------------------------------------------------------------------
/samples/TLE_constellation/beam_placement/random_placement.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : random beam placement algorithm test case in beam placement strategy
8 |
9 | '''
10 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
11 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
12 | import src.TLE_constellation.constellation_beamplacement.beam_placement_plugin_manager as beam_placement_plugin_manager
13 |
14 | def random_placement():
15 | dT = 1000
16 | constellation_name = "Starlink"
17 | # initialize the connectivity mode plugin manager
18 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
19 | # generate the bent-pipe constellations
20 | bent_pipe_constellation = constellation_configuration.constellation_configuration(dT,
21 | constellation_name=constellation_name)
22 | # modify and execute the constellation connection mode
23 | connectionModePluginManager.current_connection_mode = "bent_pipe"
24 | connectionModePluginManager.execute_connection_policy(constellation=bent_pipe_constellation, dT=dT)
25 | # initialize the beam placement plugin manager
26 | beamPlacementPluginManager = beam_placement_plugin_manager.beam_placement_plugin_manager()
27 |
28 | # execute the beam placement algorithm and return two values:
29 | # (1) the first return value is the set of all cells that can be covered by the beam in each timeslot.
30 | # it is a two-dimensional list, each element in it is a one-dimensional list, representing the set
31 | # of all covered cells in a certain timeslot.
32 | # (2) the second return value is the collection Cells composed of all cells.
33 |
34 | # h3 cell resolution
35 | h3_resolution = 1
36 | # the number of antennas each satellite is equipped with
37 | antenna_count_per_satellite = 8
38 | # the minimum elevation angle at which a satellite can be seen from a point on the ground
39 | minimum_elevation = 25
40 | covered_cells_per_timeslot, Cells = beamPlacementPluginManager.execute_beamplacement_policy(
41 | bent_pipe_constellation.shells[4],
42 | h3_resolution, antenna_count_per_satellite, dT, minimum_elevation)
43 |
44 |
45 | # covered_cells_per_timeslot is a two-dimensional list, each element of which is a one-dimensional list,
46 | # representing the set of all covered cells in a certain timeslot
47 | print("\t\t\tThe number of cells covered at every timeslot are")
48 | count = 1
49 | print("\t\t\t============================================")
50 | for every_timeslot_covered_cells in covered_cells_per_timeslot:
51 | # print("\t\t\t============================================")
52 | print("\t\t\tThe number of cells covered at timeslot-" + str(count) + " is : ",
53 | len(every_timeslot_covered_cells),
54 | " , and the total number of cells is : ", len(Cells))
55 | count += 1
56 | # print("\t\t\th3id" , "\t" , "the longitude of the center point" , "\t" , "the latitude of the center point")
57 | # for cell in every_timeslot_covered_cells:
58 | # print("\t\t\t", cell.h3id , "\t" , cell.center_longitude , "\t" , cell.center_latitude)
59 | # print("\t\t\t============================================")
60 | print("\t\t\t============================================")
61 |
62 |
63 |
64 | if __name__ == "__main__":
65 | random_placement()
--------------------------------------------------------------------------------
/samples/TLE_constellation/bent_pipe/bandwidth.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : Bandwidth test case of constellation in bent-pipe working mode
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
11 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.TLE_constellation.constellation_entity.user as USER
13 | import src.TLE_constellation.constellation_evaluation.not_exists_ISL.bandwidth as BANDWIDTH
14 |
15 |
16 | def bandwidth():
17 | dT = 1000
18 | constellation_name = "Starlink"
19 | # generate the constellations
20 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
21 | # initialize the connectivity mode plugin manager
22 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
23 | # modify and execute the constellation connection mode
24 | connectionModePluginManager.current_connection_mode = "bent_pipe"
25 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
26 | # the source of the communication pair
27 | source = USER.user(0.00, 51.30, "London")
28 | # the target of the communication pair
29 | target = USER.user(-74.00, 40.43, "NewYork")
30 | # the ground station data file path
31 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
32 | bandwidth = BANDWIDTH.bandwidth(source, target, dT, constellation.shells[4], ground_station_file)
33 | print("\t\t\tThe bandwidth from ", source.user_name, " to ", target.user_name,
34 | " for the average of all timeslots is ", bandwidth)
35 |
36 |
37 | if __name__ == "__main__":
38 | bandwidth()
--------------------------------------------------------------------------------
/samples/TLE_constellation/bent_pipe/coverage.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : Coverage test case of constellation in bent-pipe working mode
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
11 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.TLE_constellation.constellation_evaluation.not_exists_ISL.coverage as COVERAGE
13 |
14 |
15 | def coverage():
16 | dT = 1000
17 | constellation_name = "Starlink"
18 | # generate the constellations
19 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
20 | # initialize the connectivity mode plugin manager
21 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
22 | # modify and execute the constellation connection mode
23 | connectionModePluginManager.current_connection_mode = "bent_pipe"
24 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
25 | # the ground station data file path
26 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
27 | coverage_rate = COVERAGE.coverage(dT, constellation.shells[4], ground_station_file)
28 | print("\t\t\tThe coverage rates of the constellation for every timeslot are : ", coverage_rate)
29 |
30 |
31 | if __name__ == "__main__":
32 | coverage()
--------------------------------------------------------------------------------
/samples/TLE_constellation/bent_pipe/delay.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : Delay test case of constellation in bent-pipe working mode
8 |
9 | '''
10 |
11 |
12 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
13 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
14 | import src.TLE_constellation.constellation_entity.user as USER
15 | import src.TLE_constellation.constellation_evaluation.not_exists_ISL.delay as DELAY
16 |
17 | def delay():
18 | dT = 1000
19 | constellation_name = "Starlink"
20 | # generate the constellations
21 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
22 | # initialize the connectivity mode plugin manager
23 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
24 | # modify and execute the constellation connection mode
25 | connectionModePluginManager.current_connection_mode = "bent_pipe"
26 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
27 | # the source of the communication pair
28 | source = USER.user(0.00, 51.30, "London")
29 | # the target of the communication pair
30 | target = USER.user(-74.00, 40.43, "NewYork")
31 | # the ground station and POP point data file paths
32 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
33 | POP_file = "config/POPs/" + constellation_name + ".xml"
34 | minimum_delay_time = DELAY.delay(source, target, dT, constellation.shells[4], ground_station_file, POP_file)
35 | print("\t\t\tThe delay time from ", source.user_name, " to ", target.user_name, " for every timeslot is ",
36 | minimum_delay_time, " s")
37 |
38 |
39 |
40 | if __name__ == "__main__":
41 | delay()
--------------------------------------------------------------------------------
/samples/TLE_constellation/constellation_generation/constellation_generation_test.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/09
6 |
7 | Function : This script is used to test whether a constellation can be generated normally.
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
11 |
12 |
13 | def constellation_generation_test():
14 | dT = 1000
15 | constellation_name = "Starlink"
16 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
17 | print('\t\t\tDetails of the constellations are as follows :')
18 | print('\t\t\tThe name of the constellation is : ', constellation.constellation_name)
19 | print('\t\t\tThere are ', constellation.number_of_shells, ' shell(s) in this constellation')
20 | print('\t\t\tThe information for each shell is as follows:')
21 | for sh in constellation.shells:
22 | print('\t\t\tshell name : ', sh.shell_name)
23 | print('\t\t\tshell orbit altitude(km) : ', sh.altitude)
24 | print('\t\t\tThe shell contains ', len(sh.satellites), ' satellites')
25 | print('\t\t\tThe shell contains ', len(sh.orbits), ' orbits')
26 | print('\t\t\tshell orbital inclination(°) : ', sh.inclination)
27 | print('\t\t\tshell orbital period (s) : ', sh.orbit_cycle)
28 | print('\t\t\t==============================================')
29 |
30 |
31 | if __name__ == '__main__':
32 | constellation_generation_test()
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/bandwidth.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/14
6 |
7 | Function : Bandwidth test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
11 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.TLE_constellation.constellation_evaluation.exists_ISL.bandwidth as BANDWIDTH
13 | import src.TLE_constellation.constellation_entity.user as USER
14 |
15 |
16 |
17 | def bandwidth():
18 | dT = 1000
19 | constellation_name = "Starlink"
20 | # the source of the communication pair
21 | source = USER.user(0.00, 51.30, "London")
22 | # the target of the communication pair
23 | target = USER.user(-74.00, 40.43, "NewYork")
24 | # generate the constellations
25 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
26 | # initialize the connectivity mode plugin manager
27 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
28 | # execute the connectivity mode and build ISLs between satellites
29 | connectionModePluginManager.execute_connection_policy(constellation, dT)
30 | bandwidth = BANDWIDTH.bandwidth(constellation_name, source, target, constellation.shells[4],
31 | 1.1, 5, dT)
32 | print("\t\t\tThe bandwidth from ", source.user_name, " to ", target.user_name,
33 | " for the average of all timeslots is ", bandwidth)
34 |
35 |
36 | if __name__ == "__main__":
37 | bandwidth()
38 |
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/betweeness.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/15
6 |
7 | Function : Betweeness test cases under Constellation +Gird working mode
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
11 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.TLE_constellation.constellation_evaluation.exists_ISL.betweeness as BETWEENESS
13 |
14 |
15 | def betweeness():
16 | dT = 1000
17 | constellation_name = "Starlink"
18 | # generate the constellations
19 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
20 | # initialize the connectivity mode plugin manager
21 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
22 | # execute the connectivity mode and build ISLs between satellites
23 | connectionModePluginManager.execute_connection_policy(constellation, dT)
24 | betweeness = BETWEENESS.betweeness(constellation_name, constellation.shells[4])
25 | print("\t\t\tThe betweeness values of each satellite in the constellation are : ", betweeness)
26 |
27 | if __name__ == "__main__":
28 | betweeness()
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/coverage.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/15
6 |
7 | Function : Coverage test cases under Constellation +Gird working mode
8 |
9 | '''
10 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
11 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.TLE_constellation.constellation_evaluation.exists_ISL.coverage as COVERAGE
13 |
14 |
15 | def coverage():
16 | dT = 1000
17 | constellation_name = "Starlink"
18 | # generate the constellations
19 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
20 | # initialize the connectivity mode plugin manager
21 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
22 | # execute the connectivity mode and build ISLs between satellites
23 | connectionModePluginManager.execute_connection_policy(constellation, dT)
24 | coverage = COVERAGE.coverage(constellation.constellation_name, dT, constellation.shells[4])
25 | print("\t\t\tThe coverage rates of the constellation for every timeslot are : " , coverage)
26 | satellite_in_latitude, satellite_in_longitude = COVERAGE.coverage_aggregated_by_latitude_and_longitude(
27 | constellation.constellation_name, dT, constellation.shells[4])
28 | print("\t\t\tThe average number of visible satellites per timeslot is distributed by latitude : ",
29 | satellite_in_latitude)
30 | print("\t\t\tThe average number of visible satellites per timeslot is distributed by longitude : ",
31 | satellite_in_longitude)
32 |
33 |
34 | if __name__ == "__main__":
35 | coverage()
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/delay.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/15
6 |
7 | Function : Delay test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 | import src.TLE_constellation.constellation_evaluation.exists_ISL.delay as DELAY
11 | import src.TLE_constellation.constellation_entity.user as USER
12 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
13 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
14 |
15 |
16 | def delay():
17 | dT = 1000
18 | constellation_name = "Starlink"
19 | # the source of the communication pair
20 | source = USER.user(0.00, 51.30, "London")
21 | # the target of the communication pair
22 | target = USER.user(-74.00, 40.43, "NewYork")
23 | # generate the constellations
24 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
25 | # initialize the connectivity mode plugin manager
26 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
27 | # execute the connectivity mode and build ISLs between satellites
28 | connectionModePluginManager.execute_connection_policy(constellation, dT)
29 | delay = DELAY.delay(constellation.constellation_name, source, target, dT, constellation.shells[4])
30 | print("\t\t\tThe delay time from ", source.user_name, " to ", target.user_name, " for every timeslot is ", delay, " s")
31 |
32 |
33 | if __name__ == "__main__":
34 | delay()
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/least_hop_path.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : the least hop path routing test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 | import src.TLE_constellation.constellation_entity.user as USER
11 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
12 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.TLE_constellation.constellation_routing.routing_policy_plugin_manager as routing_policy_plugin_manager
14 |
15 |
16 | def least_hop_path():
17 | dT = 1000
18 | constellation_name = "Starlink"
19 | # the source of the communication pair
20 | source = USER.user(0.00, 51.30, "London")
21 | # the target of the communication pair
22 | target = USER.user(-74.00, 40.43, "NewYork")
23 | # generate the constellations
24 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
25 | # initialize the connectivity mode plugin manager
26 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
27 | # execute the connectivity mode and build ISLs between satellites
28 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
29 | # initialize the routing policy plugin manager
30 | routingPolicyPluginManager = routing_policy_plugin_manager.routing_policy_plugin_manager()
31 | # switch routing policy
32 | routingPolicyPluginManager.set_routing_policy("least_hop_path")
33 | # execute routing policy
34 | least_hop_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source,
35 | target, constellation.shells[4])
36 | print("\t\t\tThe least hop path from " , source.user_name , " to " , target.user_name , " is " , least_hop_path)
37 | # modify the source of the communication pair
38 | source = USER.user(116.41, 39.9, "Beijing")
39 | # execute routing policy
40 | least_hop_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source,
41 | target, constellation.shells[4])
42 | print("\t\t\tThe least hop path from " , source.user_name , " to " , target.user_name , " is " , least_hop_path)
43 |
44 |
45 | if __name__ == "__main__":
46 | least_hop_path()
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/second_shortest_path.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : the second shortest path routing test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 | import src.TLE_constellation.constellation_entity.user as USER
11 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
12 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.TLE_constellation.constellation_routing.routing_policy_plugin_manager as routing_policy_plugin_manager
14 |
15 | def second_shortest_path():
16 | dT = 5730
17 | constellation_name = "Starlink"
18 | # the source of the communication pair
19 | source = USER.user(0.00, 51.30, "London")
20 | # the target of the communication pair
21 | target = USER.user(-74.00, 40.43, "NewYork")
22 | # generate the constellations
23 | constellation = constellation_configuration.constellation_configuration(dT,
24 | constellation_name=constellation_name)
25 | # initialize the connectivity mode plugin manager
26 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
27 | # execute the connectivity mode and build ISLs between satellites
28 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
29 | # initialize the routing policy plugin manager
30 | routingPolicyPluginManager = routing_policy_plugin_manager.routing_policy_plugin_manager()
31 | # switch the routing policy
32 | routingPolicyPluginManager.set_routing_policy("second_shortest_path")
33 | # execute the routing policy
34 | second_minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source,
35 | target, constellation.shells[4])
36 |
37 | print("\t\t\tThe second shortest path routing from ", source.user_name, " to ", target.user_name, " is " , second_minimum_path)
38 |
39 | # modify the source of the communication pair
40 | source = USER.user(116.41, 39.9, "Beijing")
41 |
42 | second_minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source,
43 | target, constellation.shells[4])
44 | print("\t\t\tThe second shortest path routing from ", source.user_name, " to ", target.user_name, " is " , second_minimum_path)
45 |
46 |
47 | if __name__ == "__main__":
48 | second_shortest_path()
--------------------------------------------------------------------------------
/samples/TLE_constellation/positive_Grid/shortest_path.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : the shortest path routing test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 | import src.TLE_constellation.constellation_entity.user as USER
11 | import src.constellation_generation.by_TLE.constellation_configuration as constellation_configuration
12 | import src.TLE_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.TLE_constellation.constellation_routing.routing_policy_plugin_manager as routing_policy_plugin_manager
14 |
15 |
16 | def shortest_path():
17 | dT = 5730
18 | constellation_name = "Starlink"
19 | # the source of the communication pair
20 | source = USER.user(0.00, 51.30, "London")
21 | # the target of the communication pair
22 | target = USER.user(-74.00, 40.43, "NewYork")
23 | # generate the constellations
24 | constellation = constellation_configuration.constellation_configuration(dT, constellation_name)
25 | # initialize the connectivity mode plugin manager
26 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
27 | # execute the connectivity mode and build ISLs between satellites
28 | connectionModePluginManager.execute_connection_policy(constellation, dT)
29 | # initialize the routing policy plugin manager
30 | routingPolicyPluginManager = routing_policy_plugin_manager.routing_policy_plugin_manager()
31 | # execute the routing policy
32 | minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source, target,
33 | constellation.shells[4])
34 |
35 | print("\t\t\tThe shortest path routing from ", source.user_name, " to ", target.user_name, " is " , minimum_path)
36 | # modify the source of the communication pair
37 | source = USER.user(116.41, 39.9, "Beijing")
38 |
39 | minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source, target,
40 | constellation.shells[4])
41 | print("\t\t\tThe shortest path routing from ", source.user_name, " to ", target.user_name, " is " , minimum_path)
42 |
43 | if __name__ == "__main__":
44 | shortest_path()
--------------------------------------------------------------------------------
/samples/XML_constellation/__pycache__/XML_constellation_test_cases.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/__pycache__/XML_constellation_test_cases.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/beam_placement/__pycache__/random_placement.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/beam_placement/__pycache__/random_placement.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/beam_placement/random_placement.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/15
6 |
7 | Function : random beam placement algorithm test case in beam placement strategy
8 |
9 | '''
10 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
11 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.XML_constellation.constellation_beamplacement.beam_placement_plugin_manager as beam_placement_plugin_manager
13 |
14 |
15 | def random_placement():
16 | dT = 1000
17 | constellation_name = "Starlink"
18 | # initialize the connectivity mode plugin manager
19 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
20 | # generate the bent-pipe constellations
21 | bent_pipe_constellation = constellation_configuration.constellation_configuration(dT,
22 | constellation_name=constellation_name)
23 | # modify and execute the constellation connection mode
24 | connectionModePluginManager.current_connection_mode = "bent_pipe"
25 | connectionModePluginManager.execute_connection_policy(constellation=bent_pipe_constellation, dT=dT)
26 | # initialize the beam placement plugin manager
27 | beamPlacementPluginManager = beam_placement_plugin_manager.beam_placement_plugin_manager()
28 | # execute the beam placement algorithm and return two values:
29 | # (1) the first return value is the set of all cells that can be covered by the beam in each timeslot.
30 | # it is a two-dimensional list, each element in it is a one-dimensional list, representing the set
31 | # of all covered cells in a certain timeslot.
32 | # (2) the second return value is the collection Cells composed of all cells.
33 |
34 | # h3 cell resolution
35 | h3_resolution = 1
36 | # the number of antennas each satellite is equipped with
37 | antenna_count_per_satellite = 8
38 | # the minimum elevation angle at which a satellite can be seen from a point on the ground
39 | minimum_elevation = 25
40 | covered_cells_per_timeslot , Cells = beamPlacementPluginManager.execute_beamplacement_policy(bent_pipe_constellation.shells[0] ,
41 | h3_resolution , antenna_count_per_satellite , dT , minimum_elevation)
42 | # covered_cells_per_timeslot is a two-dimensional list, each element of which is a one-dimensional list,
43 | # representing the set of all covered cells in a certain timeslot
44 | print("\t\t\tThe number of cells covered at every timeslot are")
45 | count = 1
46 | print("\t\t\t============================================")
47 | for every_timeslot_covered_cells in covered_cells_per_timeslot:
48 | #print("\t\t\t============================================")
49 | print("\t\t\tThe number of cells covered at timeslot-" + str(count) + " is : " , len(every_timeslot_covered_cells) ,
50 | " , and the total number of cells is : " , len(Cells))
51 | count += 1
52 | #print("\t\t\th3id" , "\t" , "the longitude of the center point" , "\t" , "the latitude of the center point")
53 | #for cell in every_timeslot_covered_cells:
54 | # print("\t\t\t", cell.h3id , "\t" , cell.center_longitude , "\t" , cell.center_latitude)
55 | #print("\t\t\t============================================")
56 | print("\t\t\t============================================")
57 |
58 |
59 | if __name__ == "__main__":
60 | random_placement()
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/__pycache__/bandwidth.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/bent_pipe/__pycache__/bandwidth.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/__pycache__/coverage.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/bent_pipe/__pycache__/coverage.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/__pycache__/delay.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/bent_pipe/__pycache__/delay.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/__pycache__/natural_failure_satellites.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/bent_pipe/__pycache__/natural_failure_satellites.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/__pycache__/sunstorm_damaged_satellites.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/bent_pipe/__pycache__/sunstorm_damaged_satellites.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/bandwidth.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Bandwidth test case of constellation in bent-pipe working mode
8 |
9 | '''
10 |
11 |
12 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
14 | import src.XML_constellation.constellation_entity.user as USER
15 | import src.XML_constellation.constellation_evaluation.not_exists_ISL.bandwidth as BANDWIDTH
16 |
17 | # Bandwidth test case of constellation in bent-pipe working mode
18 | def bandwidth():
19 | dT=1000
20 | constellation_name = "Starlink"
21 | # initialize the connectivity mode plugin manager
22 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
23 | # generate the bent-pipe constellations
24 | bent_pipe_constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
25 | # modify and execute the constellation connection mode
26 | connectionModePluginManager.current_connection_mode = "bent_pipe"
27 | connectionModePluginManager.execute_connection_policy(constellation=bent_pipe_constellation , dT=dT)
28 | # the source of the communication pair
29 | source = USER.user(0.00 , 51.30 , "London")
30 | # the target of the communication pair
31 | target = USER.user(-74.00 , 40.43 , "NewYork")
32 | # the ground station data file path
33 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
34 | bandwidth = BANDWIDTH.bandwidth(source, target, dT, bent_pipe_constellation.shells[0], ground_station_file)
35 | print("\t\t\tThe bandwidth from ", source.user_name, " to ", target.user_name,
36 | " for the average of all timeslots is ", bandwidth)
37 |
38 |
39 | if __name__ == "__main__":
40 | bandwidth()
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/coverage.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Coverage rate test case of constellation in bent-pipe working mode
8 |
9 | '''
10 |
11 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
13 | import src.XML_constellation.constellation_evaluation.not_exists_ISL.coverage as COVERAGE
14 |
15 | # Coverage rate test case of constellation in bent-pipe working mode
16 | def coverage():
17 | dT=1000
18 | constellation_name = "Starlink"
19 | # initialize the connectivity mode plugin manager
20 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
21 | # generate the bent-pipe constellations
22 | bent_pipe_constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
23 | # modify and execute the constellation connection mode
24 | connectionModePluginManager.current_connection_mode = "bent_pipe"
25 | connectionModePluginManager.execute_connection_policy(constellation=bent_pipe_constellation , dT=dT)
26 | # the ground station data file path
27 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
28 | coverage_rate = COVERAGE.coverage(dT, bent_pipe_constellation.shells[0], ground_station_file)
29 |
30 | print("\t\t\tThe coverage rates of the constellation for every timeslot are : ", coverage_rate)
31 |
32 | if __name__ == "__main__":
33 | coverage()
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/delay.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Delay test case of constellation in bent-pipe working mode
8 |
9 | '''
10 |
11 |
12 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
14 | import src.XML_constellation.constellation_entity.user as USER
15 | import src.XML_constellation.constellation_evaluation.not_exists_ISL.delay as DELAY
16 |
17 |
18 | # Delay test case of constellation in bent-pipe working mode
19 | def delay():
20 | dT=1000
21 | constellation_name = "Starlink"
22 | # initialize the connectivity mode plugin manager
23 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
24 | # generate the bent-pipe constellations
25 | bent_pipe_constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
26 | # modify and execute the constellation connection mode
27 | connectionModePluginManager.current_connection_mode = "bent_pipe"
28 | connectionModePluginManager.execute_connection_policy(constellation=bent_pipe_constellation , dT=dT)
29 | # the source of the communication pair
30 | source = USER.user(0.00 , 51.30 , "London")
31 | # the target of the communication pair
32 | target = USER.user(-74.00 , 40.43 , "NewYork")
33 | # the ground station and POP point data file paths
34 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
35 | POP_file = "config/POPs/" + constellation_name + ".xml"
36 | minimum_delay_time = DELAY.delay(source, target, dT, bent_pipe_constellation.shells[0], ground_station_file, POP_file)
37 | print("\t\t\tThe delay time from ", source.user_name, " to ", target.user_name, " for every timeslot is ", minimum_delay_time,
38 | " s")
39 |
40 |
41 | if __name__ == "__main__":
42 | delay()
--------------------------------------------------------------------------------
/samples/XML_constellation/bent_pipe/natural_failure_satellites.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/15
6 |
7 | Function : In the bent-pipe working mode of the constellation, the satellite natural damage model is used to destroy
8 | the constellation and test the performance of the constellation.
9 |
10 | '''
11 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
12 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
13 | import src.XML_constellation.constellation_highsurvivability.damage_model_plugin_manager as constellation_damage_model_plugin_manager
14 | import src.XML_constellation.constellation_entity.user as USER
15 | import src.XML_constellation.constellation_evaluation.not_exists_ISL.delay as DELAY
16 | import src.XML_constellation.constellation_evaluation.not_exists_ISL.coverage as COVERAGE
17 | import src.XML_constellation.constellation_evaluation.not_exists_ISL.bandwidth as BANDWIDTH
18 |
19 | def natural_failure_satellites():
20 | dT = 1000
21 | constellation_name = "Starlink"
22 | # initialize the connectivity mode plugin manager
23 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
24 | # generate the bent-pipe constellations
25 | bent_pipe_constellation = constellation_configuration.constellation_configuration(dT,
26 | constellation_name=constellation_name)
27 | # modify and execute the constellation connection mode
28 | connectionModePluginManager.current_connection_mode = "bent_pipe"
29 | connectionModePluginManager.execute_connection_policy(constellation=bent_pipe_constellation, dT=dT)
30 |
31 | # initialize the constellation damage model plugin manager
32 | constellationDamageModelPluginManager = constellation_damage_model_plugin_manager.damage_model_plugin_manager()
33 | # switch the constellation destruction model to natural_failure_satellites
34 | constellationDamageModelPluginManager.current_damage_model = "natural_failure_satellites"
35 | # execute constellation destruction model
36 | constellation_natural_failure = constellationDamageModelPluginManager. \
37 | execute_damage_model(bent_pipe_constellation, bent_pipe_constellation.shells[0], 0.05, dT)
38 | # the source of the communication pair
39 | source = USER.user(0.00, 51.30, "London")
40 | # the target of the communication pair
41 | target = USER.user(-74.00, 40.43, "NewYork")
42 | # the ground station and POP point data file paths
43 | ground_station_file = "config/ground_stations/" + constellation_name + ".xml"
44 | POP_file = "config/POPs/" + constellation_name + ".xml"
45 |
46 | # latency comparison of the two constellations before and after destruction
47 | delay1 = DELAY.delay(source, target, dT, bent_pipe_constellation.shells[0], ground_station_file, POP_file)
48 | print("\t\t\tThe delay time of original constellation from ", source.user_name, " to ", target.user_name, " for every timeslot are : ", delay1, " s")
49 | delay2 = DELAY.delay(source, target, dT, constellation_natural_failure.shells[0], ground_station_file, POP_file)
50 | print("\t\t\tThe delay time of after executing the constellation destruction model from ", source.user_name, " to ", target.user_name, " for every timeslot are : ", delay2, " s")
51 |
52 |
53 | # coverage rate comparison of the two constellations before and after destruction
54 | coverage1 = COVERAGE.coverage(dT, bent_pipe_constellation.shells[0], ground_station_file)
55 | print("\t\t\tThe coverage rates of every timeslot of the original constellation are ", coverage1)
56 | coverage2 = COVERAGE.coverage(dT, constellation_natural_failure.shells[0], ground_station_file)
57 | print("\t\t\tThe coverage rates of every timeslot of after executing the constellation destruction model are ", coverage2)
58 |
59 |
60 | # bandwidth comparison of the two constellations before and after destruction
61 | bandwidth1 = BANDWIDTH.bandwidth(source, target, dT, bent_pipe_constellation.shells[0], ground_station_file)
62 | print("\t\t\tThe average bandwidth of all timeslots of original constellation from ", source.user_name, " to ", target.user_name, " is ", bandwidth1)
63 | bandwidth2 = BANDWIDTH.bandwidth(source, target, dT, constellation_natural_failure.shells[0], ground_station_file)
64 | print("\t\t\tThe average bandwidth of all timeslots of after executing the constellation destruction model from ", source.user_name, " to ", target.user_name, " is ", bandwidth2)
65 |
66 |
67 | if __name__ == "__main__":
68 | natural_failure_satellites()
--------------------------------------------------------------------------------
/samples/XML_constellation/constellation_generation/__pycache__/constellation_generation_test.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/constellation_generation/__pycache__/constellation_generation_test.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/constellation_generation/constellation_generation_test.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/23
6 |
7 | Function : This script is used to test whether a constellation can be generated normally.
8 |
9 | '''
10 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
11 |
12 |
13 | def constellation_generation_test():
14 | constellation_name = "Telesat"
15 | # generate the constellations
16 | constellation = constellation_configuration.constellation_configuration(dT=15,
17 | constellation_name=constellation_name)
18 | print('\t\t\tDetails of the constellations are as follows :')
19 | print('\t\t\tThe name of the constellation is : ' , constellation.constellation_name)
20 | print('\t\t\tThere are ' , constellation.number_of_shells , ' shell(s) in this constellation')
21 | print('\t\t\tThe information for each shell is as follows:')
22 | for sh in constellation.shells:
23 | print('\t\t\tshell name : ' , sh.shell_name)
24 | print('\t\t\tshell orbit altitude(km) : ' , sh.altitude)
25 | print('\t\t\tThe shell contains ' , sh.number_of_satellites , ' satellites')
26 | print('\t\t\tThe shell contains ' , sh.number_of_orbits , ' orbits')
27 | print('\t\t\tshell orbital inclination(°) : ' , sh.inclination)
28 | print('\t\t\tshell orbital period (s) : ' , sh.orbit_cycle)
29 | print('\t\t\t==============================================')
30 |
31 |
32 | if __name__ == '__main__':
33 | constellation_generation_test()
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/bandwidth.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/bandwidth.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/betweeness.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/betweeness.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/coverage.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/coverage.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/delay.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/delay.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/least_hop_path.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/least_hop_path.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/natural_failure_satellites.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/natural_failure_satellites.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/second_shortest_path.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/second_shortest_path.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/shortest_path.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/shortest_path.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/__pycache__/sunstorm_damaged_satellites.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/XML_constellation/positive_Grid/__pycache__/sunstorm_damaged_satellites.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/bandwidth.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Bandwidth test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 |
12 | import src.XML_constellation.constellation_entity.user as USER
13 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
14 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
15 | import src.XML_constellation.constellation_evaluation.exists_ISL.bandwidth as BANDWIDTH
16 |
17 | # Bandwidth test cases at two locations under Constellation +Gird working mode
18 | def bandwidth():
19 | dT=1000
20 | constellation_name = "Starlink"
21 | # the source of the communication pair
22 | source = USER.user(0.00 , 51.30 , "London")
23 | # the target of the communication pair
24 | target = USER.user(-74.00 , 40.43 , "NewYork")
25 | # generate the constellations
26 | constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
27 | # initialize the connectivity mode plugin manager
28 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
29 | # execute the connectivity mode and build ISLs between satellites
30 | connectionModePluginManager.execute_connection_policy(constellation=constellation , dT=dT)
31 | bandwidth = BANDWIDTH.bandwidth(constellation_name, source, target, constellation.shells[0], 1.1, 5, dT)
32 | print("\t\t\tThe bandwidth from " , source.user_name , " to " , target.user_name , " for the average of all timeslots is " , bandwidth)
33 |
34 |
35 | if __name__ == "__main__":
36 | bandwidth()
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/betweeness.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Betweeness test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
12 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.XML_constellation.constellation_evaluation.exists_ISL.betweeness as BETWEENESS
14 |
15 | # Betweeness test cases at two locations under Constellation +Gird working mode
16 | def betweeness():
17 | dT=5730
18 | constellation_name = "Starlink"
19 | # generate the constellations
20 | constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
21 | # initialize the connectivity mode plugin manager
22 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
23 | # execute the connectivity mode and build ISLs between satellites
24 | connectionModePluginManager.execute_connection_policy(constellation=constellation , dT=dT)
25 | betweeness = BETWEENESS.betweeness(constellation_name, constellation.shells[0])
26 | print("\t\t\tThe betweeness values of each satellite in the constellation are : " , betweeness)
27 |
28 | if __name__ == "__main__":
29 | betweeness()
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/coverage.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Coverage rate test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
12 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.XML_constellation.constellation_evaluation.exists_ISL.coverage as COVERAGE
14 |
15 | # Coverage rate test cases at two locations under Constellation +Gird working mode
16 | def coverage():
17 | dT=1000
18 | constellation_name = "Starlink"
19 | # generate the constellations
20 | constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
21 | # initialize the connectivity mode plugin manager
22 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
23 | # execute the connectivity mode and build ISLs between satellites
24 | connectionModePluginManager.execute_connection_policy(constellation=constellation , dT=dT)
25 | coverage= COVERAGE.coverage(constellation.constellation_name, dT, constellation.shells[0])
26 | print("\t\t\tThe coverage rates of the constellation for every timeslot are : " , coverage)
27 | satellite_in_latitude , satellite_in_longitude = COVERAGE.coverage_aggregated_by_latitude_and_longitude(constellation.constellation_name,
28 | dT, constellation.shells[0])
29 | print("\t\t\tThe average number of visible satellites per timeslot is distributed by latitude : " , satellite_in_latitude)
30 | print("\t\t\tThe average number of visible satellites per timeslot is distributed by longitude : " , satellite_in_longitude)
31 |
32 |
33 | if __name__ == "__main__":
34 | coverage()
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/delay.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : Delay test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 | import src.XML_constellation.constellation_entity.user as USER
12 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
13 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
14 | import src.XML_constellation.constellation_evaluation.exists_ISL.delay as DELAY
15 |
16 |
17 | # Delay test cases at two locations under Constellation +Gird working mode
18 | def delay():
19 | dT=5730
20 | constellation_name = "Starlink"
21 | # the source of the communication pair
22 | source = USER.user(0.00 , 51.30 , "London")
23 | # the target of the communication pair
24 | target = USER.user(-74.00 , 40.43 , "NewYork")
25 | # generate the constellations
26 | constellation= constellation_configuration.constellation_configuration(dT=dT, constellation_name=constellation_name)
27 | # initialize the connectivity mode plugin manager
28 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
29 | # execute the connectivity mode and build ISLs between satellites
30 | connectionModePluginManager.execute_connection_policy(constellation=constellation , dT=dT)
31 | delay = DELAY.delay(constellation.constellation_name, source, target, dT, constellation.shells[0])
32 | print("\t\t\tThe delay time from " , source.user_name , " to " , target.user_name , " for every timeslot is " , delay , " s")
33 |
34 | if __name__ == "__main__":
35 | delay()
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/least_hop_path.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : the least hop path routing test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 |
12 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
13 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
14 | import src.XML_constellation.constellation_routing.routing_policy_plugin_manager as routing_policy_plugin_manager
15 | import src.XML_constellation.constellation_entity.user as USER
16 |
17 |
18 | # the least hop path routing test cases at two locations under Constellation +Gird working mode
19 | def least_hop_path():
20 | dT=5730
21 | constellation_name = "Starlink"
22 | # the source of the communication pair
23 | source = USER.user(0.00 , 51.30 , "London")
24 | # the target of the communication pair
25 | target = USER.user(-74.00 , 40.43 , "NewYork")
26 | # generate the constellations
27 | constellation= constellation_configuration.constellation_configuration(dT, constellation_name=constellation_name)
28 | # initialize the connectivity mode plugin manager
29 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
30 | # execute the connectivity mode and build ISLs between satellites
31 | connectionModePluginManager.execute_connection_policy(constellation=constellation , dT=dT)
32 | # initialize the routing policy plugin manager
33 | routingPolicyPluginManager = routing_policy_plugin_manager.routing_policy_plugin_manager()
34 | # switch routing policy
35 | routingPolicyPluginManager.set_routing_policy("least_hop_path")
36 | # execute routing policy
37 | least_hop_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name , source ,
38 | target , constellation.shells[0])
39 | print("\t\t\tThe least hop path from " , source.user_name , " to " , target.user_name , " is " , least_hop_path)
40 | # modify the source of the communication pair
41 | source = USER.user(116.41 , 39.9 , "Beijing")
42 | # execute routing policy
43 | least_hop_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name , source ,
44 | target , constellation.shells[0])
45 | print("\t\t\tThe least hop path from " , source.user_name , " to " , target.user_name , " is " , least_hop_path)
46 |
47 |
48 | if __name__ == "__main__":
49 | least_hop_path()
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/second_shortest_path.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : the second shortest path routing test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
12 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.XML_constellation.constellation_routing.routing_policy_plugin_manager as routing_policy_plugin_manager
14 | import src.XML_constellation.constellation_entity.user as USER
15 |
16 | # the second shortest path routing test cases at two locations under Constellation +Gird working mode
17 | def second_shortest_path():
18 | dT = 5730
19 | constellation_name = "Starlink"
20 | # the source of the communication pair
21 | source = USER.user(0.00, 51.30, "London")
22 | # the target of the communication pair
23 | target = USER.user(-74.00, 40.43, "NewYork")
24 | # generate the constellations
25 | constellation = constellation_configuration.constellation_configuration(dT,
26 | constellation_name=constellation_name)
27 | # initialize the connectivity mode plugin manager
28 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
29 | # execute the connectivity mode and build ISLs between satellites
30 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
31 | # initialize the routing policy plugin manager
32 | routingPolicyPluginManager = routing_policy_plugin_manager.routing_policy_plugin_manager()
33 | # switch the routing policy
34 | routingPolicyPluginManager.set_routing_policy("second_shortest_path")
35 | # execute the routing policy
36 | second_minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source,
37 | target, constellation.shells[0])
38 |
39 | print("\t\t\tThe second shortest path routing from ", source.user_name, " to ", target.user_name, " is " , second_minimum_path)
40 |
41 | # modify the source of the communication pair
42 | source = USER.user(116.41, 39.9, "Beijing")
43 |
44 | second_minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source,
45 | target, constellation.shells[0])
46 | print("\t\t\tThe second shortest path routing from ", source.user_name, " to ", target.user_name, " is " , second_minimum_path)
47 |
48 |
49 | if __name__ == "__main__":
50 | second_shortest_path()
--------------------------------------------------------------------------------
/samples/XML_constellation/positive_Grid/shortest_path.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/11
6 |
7 | Function : the shortest path routing test cases at two locations under Constellation +Gird working mode
8 |
9 | '''
10 |
11 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
12 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
13 | import src.XML_constellation.constellation_routing.routing_policy_plugin_manager as routing_policy_plugin_manager
14 | import src.XML_constellation.constellation_entity.user as USER
15 |
16 | # the shortest path routing test cases at two locations under Constellation +Gird working mode
17 | def shortest_path():
18 | dT = 5730
19 | constellation_name = "Starlink"
20 | # the source of the communication pair
21 | source = USER.user(-99.14, 19.41, "Mexico City")
22 | # the target of the communication pair
23 | target = USER.user(2.17, 41.39, "Barcelona")
24 | # generate the constellations
25 | constellation = constellation_configuration.constellation_configuration(dT,
26 | constellation_name=constellation_name)
27 | # initialize the connectivity mode plugin manager
28 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
29 | # execute the connectivity mode and build ISLs between satellites
30 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
31 | # initialize the routing policy plugin manager
32 | routingPolicyPluginManager = routing_policy_plugin_manager.routing_policy_plugin_manager()
33 | # execute the routing policy
34 | minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source, target,
35 | constellation.shells[0])
36 |
37 | print("\t\t\tThe shortest path routing from ", source.user_name, " to ", target.user_name, " is " , minimum_path)
38 | # modify the source of the communication pair
39 | source = USER.user(116.41, 39.9, "Beijing")
40 |
41 | minimum_path = routingPolicyPluginManager.execute_routing_policy(constellation.constellation_name, source, target,
42 | constellation.shells[0])
43 | print("\t\t\tThe shortest path routing from ", source.user_name, " to ", target.user_name, " is " , minimum_path)
44 |
45 | if __name__ == "__main__":
46 | shortest_path()
--------------------------------------------------------------------------------
/samples/attack/attack_cases.py:
--------------------------------------------------------------------------------
1 | """
2 | Author : zhifenghan
3 |
4 | Date : 2025/05/10
5 |
6 | Function : This script is used to test multi attack
7 |
8 | """
9 |
10 | def attack_cases():
11 | print("Start ICARUS single link attack.")
12 | import samples.attack.ICARUS.single_link as SINGLE_LINK
13 | SINGLE_LINK.single_link_attack()
14 | print("Single link attack is completed.")
15 | print()
16 |
17 | print("Start ICARUS multi link attack.")
18 | import samples.attack.ICARUS.mul_link as MULTI_LINK
19 | MULTI_LINK.multi_link_attack()
20 | print("Multi link attack is completed.")
21 | print()
22 |
23 | print("Start StarMelt energy drain attack.")
24 | import samples.attack.StarMelt.energy_drain as ENERGY_DRAIN
25 | ENERGY_DRAIN.energy_drain()
26 | print("Energy drain attack is completed.")
27 | print()
28 |
29 | if __name__ == '__main__':
30 | attack_cases()
31 |
--------------------------------------------------------------------------------
/samples/duration_constellation/duration_constellation_cases.py:
--------------------------------------------------------------------------------
1 | """
2 | Author : zhifenghan
3 |
4 | Date : 2025/05/10
5 |
6 | Function : This script is used to test constellation performance
7 |
8 | """
9 |
10 | def constellation_performance():
11 | print("Calculate the time to simulate the first layer of multiple constellations")
12 | import samples.duration_constellation.simulation_performance.single_shell as SINGLE_SHELL
13 | SINGLE_SHELL.single_shell_performance()
14 | print("Simulation time cal is completed.")
15 | print()
16 |
17 | print("Calculate the delay between multiple samples")
18 | import samples.duration_constellation.network_performance.delay as DELAY
19 | DELAY.delay()
20 | print("Delay cal is completed.")
21 | print()
22 |
23 | print("Calculate the bandwidth between multiple samples")
24 | import samples.duration_constellation.network_performance.bandwidth as BANDWIDTH
25 | BANDWIDTH.bandwidth()
26 | print("Bandwidth cal is completed.")
27 | print()
28 |
29 |
30 |
31 | if __name__ == '__main__':
32 | constellation_performance()
33 |
34 |
--------------------------------------------------------------------------------
/samples/duration_constellation/network_performance/__pycache__/bandwidth.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/duration_constellation/network_performance/__pycache__/bandwidth.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/duration_constellation/network_performance/__pycache__/delay.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/duration_constellation/network_performance/__pycache__/delay.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/duration_constellation/network_performance/bandwidth.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Author : zhifenghan
4 |
5 | Date : 2025/05/10
6 |
7 | Function : This script is used to test the implemented indicator bandwidth.
8 | TThe generated traffic will be under 'data/constellation_test/'
9 |
10 | """
11 |
12 |
13 | import src.XML_constellation.constellation_entity.user as USER
14 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
15 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
16 | import src.XML_constellation.constellation_evaluation.exists_ISL.bandwidth as BANDWIDTH
17 | import numpy as np
18 | import os
19 |
20 |
21 | def bandwidth():
22 | dT = 1000
23 | constellation_name = "Starlink"
24 | London = USER.user(51.5, -0.1, "London")
25 | Washington = USER.user(38.9, -77.0, "NewYork")
26 | Istanbul = USER.user(41.0, 28.9, "Istanbul")
27 | Nairobi = USER.user(-1.3, 36.8, "Nairobi")
28 | Mumbai = USER.user(19.1, 72.9, "Mumbai")
29 | Wellington = USER.user(-41.3, 174.8, "Wellington")
30 | # Singapore = USER.user(1.3, 103.8, "Singapore")
31 | # LosAngeles = USER.user(34.1, -118.2, "LosAngeles")
32 |
33 | # generate the constellations
34 | constellation = constellation_configuration.constellation_configuration(dT=dT,
35 | constellation_name=constellation_name)
36 |
37 | # initialize the connectivity mode plugin manager
38 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
39 |
40 | # execute the connectivity mode and build ISLs between satellites
41 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
42 |
43 | path = os.path.join("data", "constellation_test", constellation_name)
44 | os.makedirs(path, exist_ok=True)
45 | bandwidth = BANDWIDTH.bandwidth(constellation_name, London, Washington, constellation.shells[0], 1.2, 5, dT)
46 | bandwidth = np.array([bandwidth])
47 | output_file = os.path.join(path, 'London_Washington_throughput.txt')
48 | np.savetxt(output_file, bandwidth, fmt='%.3f')
49 | print("The bandwidth from ", London.user_name, " to ", Washington.user_name, " is ", bandwidth,
50 | " Mbps")
51 |
52 | bandwidth = BANDWIDTH.bandwidth(constellation_name, Istanbul, Nairobi, constellation.shells[0], 1.2, 5, dT)
53 | bandwidth = np.array([bandwidth])
54 | output_file = os.path.join(path, 'Istanbul_Nairobi_throughput.txt')
55 | np.savetxt(output_file, bandwidth, fmt='%.3f')
56 | print("The bandwidth from ", Istanbul.user_name, " to ", Nairobi.user_name, " is ", bandwidth,
57 | " Mbps")
58 |
59 | bandwidth = BANDWIDTH.bandwidth(constellation_name, Mumbai, Wellington, constellation.shells[0], 1.2, 5, dT)
60 | bandwidth = np.array([bandwidth])
61 | output_file = os.path.join(path, 'Mumbai_Wellington_throughput.txt')
62 | np.savetxt(output_file, bandwidth, fmt='%.3f')
63 | print("The bandwidth from ", Mumbai.user_name, " to ", Wellington.user_name, " is ", bandwidth,
64 | " Mbps")
65 |
66 | # bandwidth = BANDWIDTH.bandwidth(constellation_name, Singapore, LosAngeles, constellation.shells[0], 1.2, 5, dT)
67 | # bandwidth = np.array([bandwidth])
68 | # np.savetxt(path + '/Singapore_LosAngeles_throughput.txt', bandwidth, fmt='%.3f')
69 |
70 | print(f"The bandwidth has been saved in {path}")
71 |
72 |
73 |
74 | if __name__ == '__main__':
75 | bandwidth()
--------------------------------------------------------------------------------
/samples/duration_constellation/network_performance/delay.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Author : zhifenghan
4 |
5 | Date : 2025/05/10
6 |
7 | Function : This script is used to test the implemented indicator delay.
8 | TThe generated traffic will be under 'data/constellation_test/'
9 |
10 | """
11 |
12 | import src.XML_constellation.constellation_entity.user as USER
13 | import src.constellation_generation.by_XML.constellation_configuration as constellation_configuration
14 | import src.XML_constellation.constellation_connectivity.connectivity_mode_plugin_manager as connectivity_mode_plugin_manager
15 | import src.XML_constellation.constellation_evaluation.exists_ISL.delay as DELAY
16 | import numpy as np
17 | import os
18 |
19 |
20 | def delay():
21 | dT = 1000
22 | constellation_name = "Starlink"
23 | London = USER.user(51.5, -0.1, "London")
24 | Washington = USER.user(38.9, -77.0, "NewYork")
25 | Istanbul = USER.user(41.0, 28.9, "Istanbul")
26 | Nairobi = USER.user(-1.3, 36.8, "Nairobi")
27 | Mumbai = USER.user(19.1, 72.9, "Mumbai")
28 | Wellington = USER.user(-41.3, 174.8, "Wellington")
29 | Singapore = USER.user(1.3, 103.8, "Singapore")
30 | LosAngeles = USER.user(34.1, -118.2, "LosAngeles")
31 |
32 | # generate the constellations
33 | constellation = constellation_configuration.constellation_configuration(dT=dT,
34 | constellation_name=constellation_name)
35 |
36 | # initialize the connectivity mode plugin manager
37 | connectionModePluginManager = connectivity_mode_plugin_manager.connectivity_mode_plugin_manager()
38 |
39 | # execute the connectivity mode and build ISLs between satellites
40 | connectionModePluginManager.execute_connection_policy(constellation=constellation, dT=dT)
41 |
42 | path = os.path.join("data", "constellation_test", constellation_name)
43 | os.makedirs(path, exist_ok=True)
44 | delay = DELAY.delay(constellation.constellation_name, London, Washington, dT, constellation.shells[0])
45 | delay = np.array(delay)
46 | output_file = os.path.join(path, 'London_Washington.txt')
47 | np.savetxt(output_file, delay, fmt='%.3f')
48 | print("The average delay time from ", London.user_name, " to ", Washington.user_name, " is ", np.mean(delay),
49 | " s")
50 |
51 | delay = DELAY.delay(constellation.constellation_name, Istanbul, Nairobi, dT, constellation.shells[0])
52 | delay = np.array(delay)
53 | output_file = os.path.join(path, 'Istanbul_Nairobi.txt')
54 | np.savetxt(output_file, delay, fmt='%.3f')
55 | print("The average delay time from ", Istanbul.user_name, " to ", Nairobi.user_name, " is ", np.mean(delay),
56 | " s")
57 |
58 | delay = DELAY.delay(constellation.constellation_name, Mumbai, Wellington, dT, constellation.shells[0])
59 | delay = np.array(delay)
60 | output_file = os.path.join(path, 'Mumbai_Wellington.txt')
61 | np.savetxt(output_file, delay, fmt='%.3f')
62 | print("The average delay time from ", Mumbai.user_name, " to ", Wellington.user_name, " is ", np.mean(delay),
63 | " s")
64 |
65 | # delay = DELAY.delay(constellation.constellation_name, Singapore, LosAngeles, dT, constellation.shells[0])
66 | # delay = np.array(delay)
67 | # np.savetxt(path + '/Singapore_LosAngeles.txt', delay, fmt='%.3f')
68 |
69 | print(f"The delay has been saved in {path}")
70 |
71 |
72 | if __name__ == '__main__':
73 | delay()
74 |
75 |
--------------------------------------------------------------------------------
/samples/duration_constellation/simulation_performance/__pycache__/single_shell.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/duration_constellation/simulation_performance/__pycache__/single_shell.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/duration_constellation/simulation_performance/single_shell.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Author : zhifenghan
4 |
5 | Date : 2025/05/10
6 |
7 | Function : This script is used to test the time required for a single-layer satellite under multiple simulation durations.
8 | The generated results will be located under "data/constellation_test/".
9 |
10 | """
11 |
12 | from src.constellation_generation.by_duration.constellation_configuration import constellation_configuration
13 | import time
14 | import numpy as np
15 | import os
16 |
17 | def single_shell_performance():
18 | # starlink : 5731、5755、5743、5718
19 | # kuiper : 5830、5805、5780
20 | # telesat : 6557、6298
21 | # OneWeb : 6556
22 | # simulation test time range : 100~5000, sampling interval=350, 15 time slots
23 |
24 | duration = list(range(100, 5001, 350))
25 | dT = 1000
26 | starlink_times = []
27 | kuiper_times = []
28 | telesat_times = []
29 | oneweb_times = []
30 | for single_dur in duration:
31 | start_time = time.time()
32 | starlink_cons = constellation_configuration(single_dur, dT, "Starlink")
33 | end_time = time.time()
34 | starlink_times.append(end_time - start_time)
35 | print(f"Simulating Starlink shell 1 for {single_dur} s takes {end_time - start_time:.3f} s of real time.")
36 |
37 | start_time = time.time()
38 | kuiper_cons = constellation_configuration(single_dur, dT, "Kuiper")
39 | end_time = time.time()
40 | kuiper_times.append(end_time - start_time)
41 | print(f"Simulating Kuiper shell 1 for {single_dur} s takes {end_time - start_time:.3f} s of real time.")
42 |
43 | start_time = time.time()
44 | telesat_cons = constellation_configuration(single_dur, dT, "Telesat")
45 | end_time = time.time()
46 | telesat_times.append(end_time - start_time)
47 | print(f"Simulating Telesat shell 1 for {single_dur} s takes {end_time - start_time:.3f} s of real time.")
48 |
49 | start_time = time.time()
50 | oneweb_cons = constellation_configuration(single_dur, dT, "OneWeb")
51 | end_time = time.time()
52 | oneweb_times.append(end_time - start_time)
53 | print(f"Simulating OneWeb shell 1 for {single_dur} s takes {end_time - start_time:.3f} s of real time.")
54 |
55 | path = os.path.join("data", "constellation_test")
56 | os.makedirs(path, exist_ok=True)
57 |
58 | starlink_times = np.array(starlink_times)
59 | np.savetxt(os.path.join(path, 'starlink_times.txt'), starlink_times)
60 | kuiper_times = np.array(kuiper_times)
61 | np.savetxt(os.path.join(path, 'kuiper_times.txt'), kuiper_times)
62 | telesat_times = np.array(telesat_times)
63 | np.savetxt(os.path.join(path, 'telesat_times.txt'), telesat_times)
64 | oneweb_times = np.array(oneweb_times)
65 | np.savetxt(os.path.join(path, 'oneweb.txt'), oneweb_times)
66 |
67 | print(f"Single shell simulation time has been saved in {path}")
68 |
69 |
70 | if __name__ == '__main__':
71 | single_shell_performance()
72 |
--------------------------------------------------------------------------------
/samples/kits/kits_test_cases.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/26
6 |
7 | Function : This script is used to test each tool script under "kits/" in starperf 2.0
8 |
9 | '''
10 |
11 | def kits_test_cases():
12 | print("\t\t\033[31mTest(01/08) : get the h3id of all cells with h3 library resolution 0-4\033[0m")
13 | # get the h3id of all cells with h3 library resolution 0-4
14 | import kits.get_h3_all_cells as GET_ALL_RESOLUTION_CELLS_H3ID
15 | GET_ALL_RESOLUTION_CELLS_H3ID.get_h3_all_cells()
16 |
17 |
18 | print("\t\t\033[31mTest(02/09) : view the h3id of h3 cells\033[0m")
19 | # view the h3id of h3 cells
20 | import kits.view_h3id_of_cells as VIEW_H3ID_OF_CELLS
21 | VIEW_H3ID_OF_CELLS.view_h3id_of_cells()
22 |
23 |
24 | print("\t\t\033[31mTest(02/08) : obtain recursively read all groups and datasets in the .h5 file and obtain its tree directory structure\033[0m")
25 | # obtain recursively read all groups and datasets in the .h5 file and obtain its tree directory structure
26 | import h5py
27 | import kits.get_h5file_tree_structure as GET_H5FILE_TREE_STRUCTURE
28 | with h5py.File('data/TLE_constellation/Starlink.h5', 'r') as file:
29 | GET_H5FILE_TREE_STRUCTURE.print_hdf5_structure(file)
30 |
31 | print("\t\t\033[31mTest(03/08) : view the h3id of all cells with the specified resolution in \"data/h3_cells_id_res0-4.h5\"\033[0m")
32 | # view the h3id of all cells with the specified resolution in "data/h3_cells_id_res0-4.h5"
33 | import kits.print_h3_cells_h3id as PRINT_H3_CELLS_H3ID
34 | PRINT_H3_CELLS_H3ID.print_h3_cells_h3id(0)
35 |
36 | print("\t\t\033[31mTest(04/08) : read the position matrix data in the h5 file\033[0m")
37 | # read the position matrix data in the h5 file
38 | import kits.get_h5file_satellite_position_data as GET_H5FILE_SATELLITE_POSITION_DATA
39 | GET_H5FILE_SATELLITE_POSITION_DATA.get_h5file_satellite_position_data('data/XML_constellation/Starlink.h5')
40 |
41 | print("\t\t\033[31mTest(05/08) : read the delay matrix data in the h5 file\033[0m")
42 | # read the delay matrix data in the h5 file
43 | import kits.get_h5file_satellite_delay_data as GET_H5FILE_SATELLITE_DELAY_DATA
44 | GET_H5FILE_SATELLITE_DELAY_DATA.get_h5file_satellite_delay_data()
45 |
46 | print("\t\t\033[31mTest(06/08) : download today TLE data\033[0m")
47 | # download today TLE data
48 | import kits.download_today_TLE_data as DOWNLOAD_TODAY_TLE_DATA_TEST
49 | DOWNLOAD_TODAY_TLE_DATA_TEST.download_today_TLE_data(constellation_name = "Starlink")
50 |
51 | print("\t\t\033[31mTest(07/08) : view constellation TLE data\033[0m")
52 | # view constellation TLE data
53 | import kits.view_constellation_TLE_data as VIEW_CONSTELLATION_TLE_DATA_TEST
54 | constellation_name = "Starlink"
55 | VIEW_CONSTELLATION_TLE_DATA_TEST.view_constellation_TLE_data(constellation_name)
56 |
57 | print("\t\t\033[31mTest(08/08) : draw the sub-satellite point trajectories of all satellites in an orbit as well as the distribution of ground stations and POPs on a world map\033[0m")
58 | # draw the sub-satellite point trajectories of all satellites in an orbit as well as the distribution of
59 | # ground stations and POPs on a world map
60 | import kits.draw_subsatellite_point_track_and_GSs as draw
61 | draw.draw_subsatellite_point_track_and_GSs()
62 |
63 | if __name__ == "__main__":
64 | kits_test_cases()
--------------------------------------------------------------------------------
/samples/standalone_module/__pycache__/standalone_module_test_cases.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/samples/standalone_module/__pycache__/standalone_module_test_cases.cpython-310.pyc
--------------------------------------------------------------------------------
/samples/standalone_module/standalone_module_test_cases.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/25
6 |
7 | Function : This script is used to test each tool script under "src/standalone_module/" in starperf 2.0
8 |
9 | '''
10 |
11 |
12 |
13 |
14 |
15 |
16 | def standalone_module_test_cases():
17 | print("\t\t\033[31mTest(01/04) : calculate the length of time a user can see a satellite\033[0m")
18 | # calculate the length of time a user can see a satellite
19 | import src.standalone_module.satellite_visibility_time as SATELLITE_VISIBILITY_TIME
20 | θ = 25 # the lowest elevation angle at which the user can see the satellite (unit: degrees)
21 | h = 550 # the height of a satellite's orbit above the earth's surface, in kilometers
22 | visibility_time = SATELLITE_VISIBILITY_TIME.satellite_visibility_time(θ , h)
23 | print("\t\t\tWhen the lowest elevation angle at which a user can see a satellite is " + str(θ) + \
24 | "° and the satellite orbit height is " + str(h) + " km, the user can see a satellite for " + \
25 | str(round(visibility_time,2)) + " s.")
26 |
27 | print("\t\t\033[31mTest(02/04) : calculate satellite orbital period\033[0m")
28 | # calculate satellite orbital period
29 | import src.standalone_module.satellite_orbital_period as SATELLITE_ORBITAL_PERIOD
30 | h = 550 # the height of a satellite's orbit above the earth's surface, in kilometers
31 | orbital_period = SATELLITE_ORBITAL_PERIOD.satellite_orbital_period(h)
32 | print("\t\t\tWhen the satellite orbit height is " + str(h) + " km, the satellite orbital period is " + \
33 | str(round(orbital_period,2)) + " s.")
34 |
35 | print("\t\t\033[31mTest(03/04) : calculate satellite redundancy\033[0m")
36 | import src.standalone_module.satellite_redundancy as satellite_redundancy
37 | satellite_redundancy.satellite_redundancy(1, "OneWeb", 1000,
38 | "XML")
39 |
40 | print("\t\t\033[31mTest(04/04) : calculate polar constellation coverage ratios\033[0m")
41 | import src.standalone_module.polar_constellation_coverage as POLAR_CONSTELLATION_COVERAGE
42 | POLAR_CONSTELLATION_COVERAGE.start("Polar", 25)
43 |
44 |
45 | if __name__ == '__main__':
46 | standalone_module_test_cases()
--------------------------------------------------------------------------------
/samples/traffic/traffic_generation_cases.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Author : zhifenghan
4 |
5 | Date : 2025/05/10
6 |
7 | Function : This script is used to test the functionality of the traffic generation plugin.
8 | The generated traffic will be under 'data/'
9 |
10 | """
11 |
12 | import src.XML_constellation.constellation_traffic.traffic_plugin_manager as traffic_plugin_manager
13 | from src.constellation_generation.by_duration.constellation_configuration import constellation_configuration
14 |
15 | def traffic_generation():
16 | duration = 10
17 | dT = 1
18 | cons_name = 'Starlink'
19 | constellation = constellation_configuration(duration, dT, cons_name, shell_index=1)
20 |
21 | Traffic = traffic_plugin_manager.traffic_plugin_manager()
22 | for t in range(1, duration + 1):
23 | Traffic.execute_traffic_policy(constellation, t)
24 |
25 | print("Traffic generation is completed for " + str(duration) + " s.")
26 | print()
27 |
28 |
29 | if __name__ == '__main__':
30 | traffic_generation()
31 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_connectivity/connectivity_mode_plugin_manager.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/03
6 |
7 | Function : This script defines a manager class for the connection methods between satellites in the constellation.
8 | This is an open interface that can easily access any connection method, such as motif, +Grid, etc. If you
9 | want to add a new connection mode in the future, you only need to write functions according to the interface
10 | specification document.
11 |
12 | Requirements : All connection modes of this project are stored in the connection_plugin folder. Each py file contains a
13 | function. A function is the definition of a connection mode. The function name is the same as the file
14 | name.
15 |
16 | '''
17 | import importlib
18 | import os
19 |
20 |
21 | class connectivity_mode_plugin_manager:
22 | def __init__(self):
23 | # the connection mode plug-in dictionary stores all the connection mode plug-ins in this project. The key of
24 | # the dictionary is the function name of the connection mode, and the value is the function corresponding to
25 | # the connection mode.
26 | self.plugins = {}
27 |
28 | # the following code block is used to traverse the
29 | # src/TLE_constellation/constellation_connectivity/connectivity_plugin folder,
30 | # which stores the py files of all connection modes.
31 |
32 | # traverse this folder to obtain the names of all connection mode plug-ins and store them in the self.plugins
33 | # collection.
34 |
35 | package_name = "src.TLE_constellation.constellation_connectivity.connectivity_plugin"
36 | plugins_path = package_name.replace(".", os.path.sep) # the path where the plug-in is stored
37 | for plugin_name in os.listdir(plugins_path):
38 | if plugin_name.endswith(".py"):
39 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
40 | plugin = importlib.import_module(package_name + "." + plugin_name)
41 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
42 | function = getattr(plugin, plugin_name)
43 | self.plugins[plugin_name] = function
44 | # set the connection mode used by the current connection mode plug-in manager. The default connection mode is
45 | # "n_nearest"
46 | self.current_connection_mode = "n_nearest"
47 |
48 |
49 |
50 | # the function of this function is to clear all ISLs in the incoming satellite constellation.
51 | def clear_ISL(self, constellation):
52 | for shell in constellation.shells:
53 | for orbit in shell.orbits:
54 | for satellite in orbit.satellites:
55 | satellite.ISL.clear() # clear satellite ISL
56 |
57 |
58 |
59 | # Function : switch the connection mode
60 | # Parameters :
61 | # plugin_name : the name of the new connection mode
62 | def set_connection_mode(self, plugin_name):
63 | self.current_connection_mode = plugin_name # set the current connection mode to the specified mode
64 | #print("The current constellation connection mode has been switched to " + plugin_name)
65 |
66 |
67 |
68 | # Function : execute constellation connection mode
69 | # Parameters:
70 | # constellation : the constellation to establish connection
71 | # dT : the time interval
72 | # n : each satellite can establish up to n ISLs
73 | def execute_connection_policy(self , constellation , dT , n = 4):
74 | self.clear_ISL(constellation) # clear all existing ISLs
75 | function = self.plugins[self.current_connection_mode]
76 | function(constellation, dT , n) # go to execute the corresponding connection mode function
77 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_connectivity/connectivity_plugin/ISL_distance_range.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 500
4 | 2000
5 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_connectivity/connectivity_plugin/bent_pipe.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/03
6 |
7 | Function : This script is used to simulate the constellation working in bent-pipe mode, and there is no ISL between
8 | satellites.
9 |
10 | Specific implementation: The constellation has generated various shells, orbits, and satellites during initialization.
11 | There is no ISL between satellites in this mode, so there is nothing to do here, just return
12 | directly.
13 |
14 | '''
15 |
16 |
17 | def bent_pipe(constellation = None , dT = None , n = None):
18 | pass
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_connectivity/connectivity_plugin/positive_Grid.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/03
6 |
7 | Function : This script is used to simulate the constellation working in +Grid mode
8 |
9 | In +grid mode, one satellite will establish 4 ISLs, which is equivalent to n=4 in the "n-nearest" connection mode.
10 | Therefore, +Gird can be regarded as an "n-nearest" connection with n=4.
11 |
12 | '''
13 | import src.TLE_constellation.constellation_connectivity.connectivity_plugin.n_nearest as N_NEAREST
14 |
15 |
16 | # Parameters:
17 | # constellation : the constellation to establish +Grid connection
18 | # dT : the time interval
19 | # n : each satellite can establish up to n ISLs
20 | def positive_Grid(constellation , dT , n=4):
21 | N_NEAREST.n_nearest(constellation , dT , n)
22 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_connectivity/connectivity_plugin/ring.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/03
6 |
7 | Function : Analog constellation ring connection mode
8 |
9 |
10 | Ring connection: Only intra-track ISL is established, and there is no inter-track ISL. When two communicating
11 | parties communicate, the source first sends data to a satellite in an orbit (marked as orbit1),
12 | and then the data is transmitted between ISLs in orbit1. When the data can be seen on at least
13 | one ground station on the satellite in orbit1, the satellite sends the data to the ground station
14 | (denoted as GS1), and GS1 then accesses the ground network through a POP point (denoted as POP1).
15 | The destination will also go through such a process when sending data to the source. There will
16 | also be an orbit (denoted as orbit2), a ground station (denoted as GS2) and a POP point (denoted
17 | as POP2). Then the data transfer path is: source→orbit1→GS1→POP1→POP2→GS2→orbit2→destination.
18 |
19 | When the satellite cannot see any ground station, the data will continue to be transmitted between
20 | ISLs in the orbit, and keep going in circles until the satellite can see the ground station due to
21 | the offset of the sub-satellite point. sent to the ground station.
22 |
23 | '''
24 |
25 | def ring():
26 | pass
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/ISL.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/14
6 |
7 | Function : This file defines the inter-satellite link class ISL, which is the base class for all ISLs in this project.
8 | ISL is responsible for connecting two satellites and has no directionality, so there is no need to
9 | distinguish between source and destination satellites.
10 |
11 | '''
12 |
13 | class ISL:
14 | def __init__(self , satellite1 , satellite2 , data_rate=5, frequency_band =5, capacity =5):
15 | self.satellite1 = satellite1.id # the id of the first satellite, int type
16 | self.satellite2 = satellite2.id # the id of the second satellite, int type
17 | # data transfer rate (bps)
18 | self.data_rate = data_rate
19 | # laser band
20 | self.frequency_band = frequency_band
21 | # the capacity of ISL
22 | self.capacity = capacity
23 | # the distance between the two satellites connected by ISL, the unit is kilometers km. This parameter is of
24 | # list type because it needs to store the distances of different timeslots.
25 | self.distance = []
26 | # the delay between the two satellites connected by ISL, in seconds, this parameter is of list type because it
27 | # needs to store the delay time of different timeslots.
28 | self.delay = []
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/POP.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/06
6 |
7 | Function : This file defines the POP point class. The POP point is an entrance and exit that must be passed through
8 | before the satellite transmits the signal to the ground station GS before accessing the ground Internet.
9 |
10 | '''
11 |
12 | class POP:
13 | def __init__(self , longitude, latitude , POP_name=None):
14 | self.POP_name = POP_name # the name of POP
15 | self.longitude = longitude # the longitude of POP
16 | self.latitude = latitude # the latitude of POP
17 |
18 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/__pycache__/constellation.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/TLE_constellation/constellation_entity/__pycache__/constellation.cpython-310.pyc
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/__pycache__/launch.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/TLE_constellation/constellation_entity/__pycache__/launch.cpython-310.pyc
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/__pycache__/orbit.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/TLE_constellation/constellation_entity/__pycache__/orbit.cpython-310.pyc
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/__pycache__/satellite.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/TLE_constellation/constellation_entity/__pycache__/satellite.cpython-310.pyc
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/__pycache__/shell.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/TLE_constellation/constellation_entity/__pycache__/shell.cpython-310.pyc
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/constellation.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/09
6 |
7 | Function : This file defines the constellation class.
8 |
9 | '''
10 |
11 |
12 | class constellation:
13 | def __init__(self , constellation_name , number_of_shells , shells):
14 | self.constellation_name = constellation_name # constellation name
15 | self.number_of_shells = number_of_shells # the number of shells contained in the constellation
16 | # which shells are included in the constellation? it is a list type object, which stores shell class objects.
17 | self.shells = shells
18 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/ground_station.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/06
6 |
7 | Function : This file defines the ground station GS class. GS is located on the earth's surface. When instantiating GS,
8 | the longitude and latitude must be passed in.
9 |
10 | '''
11 |
12 | class ground_station:
13 | def __init__(self , longitude, latitude , description = None , frequency=None , antenna_count = None ,
14 | uplink_GHz = None , downlink_GHz = None):
15 | self.longitude = longitude # the longitude of GS
16 | self.latitude = latitude # the latitude of GS
17 | self.description = description # the position of GS
18 | self.frequency = frequency # the frequency of GS, such as Ka,E and so on
19 | self.antenna_count = antenna_count # the number of antenna of GS
20 | self.uplink_GHz = uplink_GHz # the uplink GHz of GS
21 | self.downlink_GHz = downlink_GHz # the downlink GHz of GS
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/launch.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/30
6 |
7 | Function : This file defines the launch class, which is used to describe satellite-related information in a rocket
8 | launch, including three attributes: cospar_id, Altitude and Inclination.
9 |
10 | cospar_id is International Designator, is an international identifier assigned to artificial objects in
11 | space. For example, "2019-074" means the 74th launch mission in 2019. Multiple satellites may be included
12 | in a single launch. The identifier of each satellite is to add uppercase English letters after cospar_id,
13 | such as "2019-074C", "2022-136H", etc.
14 |
15 | The two attributes altitude and inclination respectively represent the orbital altitude and orbital
16 | inclination of the satellite to be launched.
17 |
18 | '''
19 |
20 |
21 | class launch:
22 | def __init__(self, cospar_id , altitude , inclination):
23 | self.cospar_id = cospar_id # str
24 | self.altitude = altitude # float
25 | self.inclination = inclination # float
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/orbit.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/02
6 |
7 | Function : This file defines the orbit class for Constellation
8 |
9 | '''
10 |
11 |
12 | class orbit:
13 | def __init__(self , shell , raan_lower_bound , raan_upper_bound):
14 | # shell class variables are used to represent the shell to which the current orbit belongs
15 | self.shell = shell
16 | # satellites in this orbit
17 | self.satellites = []
18 | # the lower and upper bounds of the right ascension of the ascending node of the satellite in this orbit
19 | self.raan_lower_bound = raan_lower_bound
20 | self.raan_upper_bound = raan_upper_bound
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/satellite.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/01
6 |
7 | Function : This file defines the satellite class for Constellation
8 |
9 | '''
10 |
11 |
12 | class satellite:
13 | def __init__(self , tle_json , tle_2le):
14 | # TLE in json format. This property is a dict object that holds various fields in JSON format
15 | self.tle_json = tle_json
16 | # TLE in 2le format. This property is a tuple object that contains two elements, each of which is a string
17 | # representing tle data in 2le format
18 | self.tle_2le = tle_2le
19 | # cospar_id of current satellite
20 | self.cospar_id = self.tle_json["OBJECT_ID"][:8]
21 | # shell class variables are used to represent the shell to which the current satellite belongs
22 | self.shell = None
23 | # orbit class variables are used to represent the orbit to which the current satellite belongs
24 | self.orbit = None
25 | # longitude (degree), because the satellite is constantly moving, there are many longitudes. Use the list type
26 | # to store all the longitudes of the satellite.
27 | self.longitude = []
28 | # latitude (degree), because the satellite is constantly moving, there are many latitudes. Use the list type
29 | # to store all the latitudes of the satellite.
30 | self.latitude = []
31 | # altitude (km), because the altitude is constantly moving, there are many altitudes. Use the list type
32 | # to store all the altitudes of the satellite.
33 | self.altitude = []
34 | # list type attribute, which stores the current satellite and which satellites have established ISL, stores
35 | # the ISL object
36 | self.ISL = []
37 | # the id number of the satellite
38 | self.id = -1
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/shell.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/30
6 |
7 | Function : This file defines the shell class for Constellation
8 |
9 | '''
10 |
11 |
12 | class shell:
13 | def __init__(self, altitude, inclination , shell_name):
14 | self.altitude = altitude # km
15 | self.inclination = inclination # degree
16 | # list type variable, each element of which is a satellite class object, this attribute is used to store all
17 | # satellites in this layer of shell
18 | self.satellites = []
19 | # orbits in this layer of shell
20 | self.orbits = []
21 | # the orbital period of this layer’s shell
22 | self.orbit_cycle = None
23 | # the name of the shell
24 | self.shell_name = shell_name
25 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_entity/user.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/14
6 |
7 | Function : This file defines the user terminal class, the source endpoint and destination endpoint that need to be
8 | specified in communication, and these endpoints are the instantiation objects of this class. User terminals
9 | are all located on the surface of the earth, and the longitude and latitude must be passed in when
10 | instantiating this class.
11 |
12 | '''
13 |
14 | class user:
15 | def __init__(self, longitude, latitude, user_name=None):
16 | self.user_name = user_name # the name of user
17 | self.longitude = longitude # the longitude of user
18 | self.latitude = latitude # the latitude of user
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_evaluation/exists_ISL/betweeness.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/15
6 |
7 | Function : Calculate the betweeness value of each satellite in a satellite constellation shell
8 |
9 | '''
10 | import networkx as nx
11 | import h5py
12 | import numpy as np
13 |
14 |
15 |
16 | # Parameters:
17 | # constellation_name : the name of the constellation, and the parameter type is a string, such as "Starlink"
18 | # sh : a shell class object, representing a shell in the constellation
19 | # t : a certain time slot (timeslot)
20 | def betweeness(constellation_name , sh , t=1):
21 | file_path = "data/TLE_constellation/" + constellation_name + ".h5" # h5 file path and name
22 | # read the delay matrix of the shell layer of the constellation constellation at time t
23 | with h5py.File(file_path, 'r') as file:
24 | # access the existing first-level subgroup delay group
25 | delay_group = file['delay']
26 | # access the existing secondary subgroup 'shell'+str(count) subgroup
27 | current_shell_group = delay_group[sh.shell_name]
28 | # read the data set
29 | delay = np.array(current_shell_group['timeslot' + str(t)]).tolist()
30 |
31 | G = nx.Graph() # create an undirected graph object named G, which is empty at first, with no nodes and edges.
32 | satellite_nodes = []
33 | for i in range(1, len(delay), 1):
34 | satellite_nodes.append("satellite_" + str(i))
35 | G.add_nodes_from(satellite_nodes) # add nodes to an undirected graph
36 |
37 | satellite_edges = []
38 | for i in range(1, len(delay), 1):
39 | for j in range(i + 1, len(delay), 1):
40 | if delay[i][j] > 0:
41 | satellite_edges.append(("satellite_" + str(i), "satellite_" + str(j), delay[i][j]))
42 | # add an edge to an undirected graph. The weight of the edge is the value in the delay matrix.
43 | G.add_weighted_edges_from(satellite_edges)
44 | # calculate the betweenness centrality value of each satellite
45 | score = nx.betweenness_centrality(G)
46 | bet = []
47 | for item in score.keys():
48 | bet.append(score[item])
49 | return bet
50 |
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_highsurvivability/damage_model_plugin_manager.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : Constellation damage model plug-in manager, used to manage all constellation damage models. Write a
8 | constellation damage model plug-in manager to store all damage models as plug-ins, such as satellite
9 | natural aging damage, solar storm concentrated damage and other models. If users want to implement
10 | their own damage models, they only need to write the script themselves and put it in the specified
11 | location. In this way, a unified interface is formed to manage all damage models, and this interface
12 | is the Constellation Damage Model Plug-in Manager , it treats each damage model as a plug-in, which
13 | users can implement and use as needed.
14 |
15 | '''
16 | import os
17 | import importlib
18 |
19 | class damage_model_plugin_manager:
20 | def __init__(self):
21 | # constellation damage model plug-in dictionary stores all constellation damage model plug-ins in this project.
22 | # The key of the dictionary is the function name of the damaged model, and the value is the function
23 | # corresponding to the damaged model.
24 | self.plugins = {}
25 |
26 | # traverse this folder to obtain the names of all damaged model plug-ins and store them in the
27 | # self.plugins dictionary.
28 | package_name = "src.TLE_constellation.constellation_highsurvivability.damage_model_plugin"
29 | plugins_path = package_name.replace(".", os.path.sep) # the path where the plug-in is stored
30 | for plugin_name in os.listdir(plugins_path):
31 | if plugin_name.endswith(".py"):
32 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
33 | plugin = importlib.import_module(package_name + "." + plugin_name)
34 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
35 | function = getattr(plugin, plugin_name)
36 | self.plugins[plugin_name] = function
37 | # set the damage mode used by the current damage model plug-in manager. The default is the solar storm
38 | # concentrated damage model.
39 | self.current_damage_model = "sunstorm_damaged_satellites"
40 |
41 | # switch the damaged model
42 | # Parameter meaning: plugin_name is the name of the new damaged model
43 | def set_damage_model(self, plugin_name):
44 | self.current_damage_model = plugin_name # sets the current damage model to the specified model
45 | print("The current constellation damage model has been switched to " + plugin_name)
46 |
47 |
48 |
49 | # Function : execute the constellation damage model and start destroying the constellation
50 | # according to the specified pattern
51 | # Parameters:
52 | # constellation : the constellation that needs to be destroyed and is a constellation class object.
53 | # sh : the shell that needs to be destroyed by the solar storm and is a shell class object
54 | # num_of_damaged_satellites : the number of randomly destroyed satellites. If the value is less than 1, it is the
55 | # number of satellites destroyed as a percentage of the total number; if the value is
56 | # greater than 1, it is the number of satellites that need to be destroyed.
57 | # dT : how often a timeslot is recorded
58 | # satrt_satellite_id : the id of the most central satellite in a group of satellites to be destroyed. If
59 | # satrt_satellite_id is -1, it means that the id of the center satellite of the destroyed group is
60 | # not specified, but a randomly generated one.
61 | # Return Value : returns the constellation name after num_of_damaged_satellites satellites have been destroyed
62 | def execute_damage_model(self , constellation , sh , num_of_damaged_satellites , dT , satrt_satellite_id = -1):
63 | function = self.plugins[self.current_damage_model]
64 | constellation_copy = function(constellation , sh , num_of_damaged_satellites , dT , satrt_satellite_id)
65 | return constellation_copy
--------------------------------------------------------------------------------
/src/TLE_constellation/constellation_routing/routing_policy_plugin_manager.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author: yunanhou
4 |
5 | Date : 2023/12/16
6 |
7 | Function : Constellation routing policy plug-in manager is used to manage all constellation routing policy models.
8 | Write a constellation routing policy plug-in manager to store all routing strategies as plug-ins, such as
9 | shortest path routing, least hop routing and other models. If users want to implement their own routing
10 | model, they only need to write the script themselves and put it in the specified location. In this way,
11 | a unified interface is formed to manage all routing policy models, and this interface is the management of
12 | the constellation routing model plug-in. The router treats each routing model as a plug-in, which users can
13 | implement and use as needed. Each routing strategy is plug-in-based, defining a unified interface for
14 | routing strategies and implementing three methods: shortest path routing, second-shortest path routing and
15 | least hop routing. If you want to simulate other routing strategies in the future, you only need to write
16 | your own script according to the interface specifications. To implement a new
17 | constellation routing policy model, users only need to write their own kits according to the agreed
18 | interface specifications and put them in this path.
19 |
20 | '''
21 | import os
22 | import importlib
23 |
24 |
25 | class routing_policy_plugin_manager:
26 | def __init__(self):
27 | # constellation routing policy model plug-in dictionary stores all constellation routing model plug-ins in this
28 | # project. The key of the dictionary is the function name of the routing model, and the value is the function
29 | # corresponding to the routing model.
30 | self.plugins = {}
31 | # traverse this folder to obtain the names of all routing model plug-ins and store them in the self.plugins
32 | # collection.
33 | package_name = "src.TLE_constellation.constellation_routing.routing_policy_plugin"
34 | plugins_path = package_name.replace(".", os.path.sep) # the path where the plug-in is stored
35 | for plugin_name in os.listdir(plugins_path):
36 | if plugin_name.endswith(".py"):
37 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
38 | plugin = importlib.import_module(package_name + "." + plugin_name)
39 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
40 | function = getattr(plugin, plugin_name)
41 | self.plugins[plugin_name] = function
42 | # set the routing mode used by the current routing policy model plug-in manager. The shortest path routing model
43 | # is used by default.
44 | self.current_routing_policy = "shortest_path"
45 |
46 | # switch routing policy
47 | # Parameters:
48 | # plugin_name : the name of the new routing policy
49 | def set_routing_policy(self, plugin_name):
50 | self.current_routing_policy = plugin_name # set the current routing policy to the specified model
51 | #print("The current constellation routing policy has been switched to " + plugin_name)
52 |
53 |
54 |
55 | # Function : implement corresponding routing policies
56 | # Parameters:
57 | # constellation_name : the name of the constellation, and the parameter type is a string, such as "Starlink"
58 | # source : the source ground station
59 | # target : the target ground station
60 | # t : a certain time slot (timeslot)
61 | # sh : a shell class object, representing a shell in the constellation
62 | def execute_routing_policy(self , constellation_name , source , target , sh , t=1):
63 | function = self.plugins[self.current_routing_policy]
64 | target_routing_path = function(constellation_name , source , target , sh , t)
65 | return target_routing_path
66 |
67 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_attack/__pycache__/attack_plugin_manager.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_attack/__pycache__/attack_plugin_manager.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_attack/attack_plugin/__pycache__/icarus_single_link_attack.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_attack/attack_plugin/__pycache__/icarus_single_link_attack.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_attack/attack_plugin/__pycache__/positive_grid_energy_drain.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_attack/attack_plugin/__pycache__/positive_grid_energy_drain.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_attack/attack_plugin/__pycache__/positive_grid_icarus.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_attack/attack_plugin/__pycache__/positive_grid_icarus.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_attack/attack_plugin_manager.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Author : zhifenghan
4 |
5 | Date : 2025/05/09
6 |
7 | Function : This class manages attack plugins for constellation simulations. It dynamically loads
8 | attack modules/plugins from the specified directory, registers them, and provides methods
9 | to execute different types of attacks on constellation networks including Icarus attacks,
10 | single link attacks, and energy drain attacks.
11 |
12 | """
13 |
14 | import os
15 | import importlib
16 |
17 | class attack_plugin_manager:
18 | def __init__(self):
19 | # Store all attack plugins in this dictionary
20 | self.plugins = {}
21 | # Traverse this folder to obtain all traffic model plugins
22 | package_name = "src.XML_constellation.constellation_attack.attack_plugin"
23 | plugins_path = package_name.replace(".", os.path.sep)
24 | for plugin_name in os.listdir(plugins_path):
25 | if plugin_name.endswith(".py"):
26 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
27 | plugin = importlib.import_module(package_name + "." + plugin_name)
28 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
29 | function = getattr(plugin, plugin_name)
30 | self.plugins[plugin_name] = function
31 |
32 | # Defualt to the positive_grid_icarus model
33 | self.current_attack_model = "positive_grid_icarus"
34 |
35 | # Switcch the traffic generation model
36 | def set_attack_model(self, plugin_name):
37 | if plugin_name in self.plugins:
38 | self.current_attack_model = plugin_name
39 | else:
40 | raise ValueError(f"Plugin {plugin_name} not found!")
41 | # print("The current constellation traffic model has been switched to " + plugin_name)
42 |
43 | # Execute the corresponding traffic generation policy
44 | def execute_icarus_attack(self, constellation, time_slot,
45 | link_utilization_ratio=0.9,
46 | target_affected_traffic=300000, traffic_thre=20,
47 | GSL_capacity=4096, unit_traffic=20,
48 | given_bot_number=3000):
49 |
50 | function = self.plugins[self.current_attack_model]
51 |
52 | return function(constellation, time_slot,
53 | link_utilization_ratio, target_affected_traffic,
54 | traffic_thre, GSL_capacity,
55 | unit_traffic, given_bot_number)
56 |
57 | def execute_single_link_attack(self, constellation, time_slot, src_lat=48.8667,
58 | src_lon=2.4167, dst_lat=40.4168, dst_lon=-3.7038,
59 | link_num=500, rate=40):
60 | function = self.plugins[self.current_attack_model]
61 |
62 | return function(constellation, time_slot, src_lat, src_lon,
63 | dst_lat, dst_lon, link_num, rate)
64 |
65 | def execute_energy_drain_attack(self, constellation, time_slot, dT=30, bot_num=500, unit_traffic=20, base_power=1000):
66 | function = self.plugins[self.current_attack_model]
67 |
68 | return function(constellation, time_slot, dT, bot_num, unit_traffic, base_power)
69 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_beamplacement/__pycache__/beam_placement_plugin_manager.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_beamplacement/__pycache__/beam_placement_plugin_manager.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_beamplacement/beam_placement_plugin/__pycache__/random_placement.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_beamplacement/beam_placement_plugin/__pycache__/random_placement.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_connectivity/__pycache__/connectivity_mode_plugin_manager.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_connectivity/__pycache__/connectivity_mode_plugin_manager.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_connectivity/connectivity_mode_plugin_manager.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This script defines a manager class for the connection methods between satellites in the constellation.
8 | This is an open interface that can easily access any connection method, such as motif, +Grid, etc. If you
9 | want to add a new connection mode in the future, you only need to write functions according to the interface
10 | specification document.
11 |
12 | Requirements : All connection modes of this project are stored in the connection_plugin folder. Each py file contains a
13 | function. A function is the definition of a connection mode. The function name is the same as the file
14 | name.
15 |
16 | '''
17 |
18 | import importlib
19 | import os
20 |
21 | class connectivity_mode_plugin_manager:
22 | def __init__(self):
23 | # the connection mode plug-in dictionary stores all the connection mode plug-ins in this project. The key of
24 | # the dictionary is the function name of the connection mode, and the value is the function corresponding to
25 | # the connection mode.
26 | self.plugins = {}
27 | # the following code block is used to traverse the
28 | # src/XML_constellation/constellation_connectivity/connectivity_plugin folder,
29 | # which stores the py files of all connection modes.
30 |
31 | # traverse this folder to obtain the names of all connection mode plug-ins and store them in the self.plugins
32 | # collection.
33 | package_name = "src.XML_constellation.constellation_connectivity.connectivity_plugin"
34 | plugins_path = package_name.replace(".", os.path.sep) # the path where the plug-in is stored
35 | for plugin_name in os.listdir(plugins_path):
36 | if plugin_name.endswith(".py"):
37 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
38 | plugin = importlib.import_module(package_name + "." + plugin_name)
39 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
40 | function = getattr(plugin, plugin_name)
41 | self.plugins[plugin_name] = function
42 | # set the connection mode used by the current connection mode plug-in manager. The default connection mode is
43 | # +Grid.
44 | self.current_connection_mode = "positive_Grid"
45 |
46 | # the function of this function is to clear all ISLs in the incoming satellite constellation.
47 | def clear_ISL(self , constellation):
48 | for shell in constellation.shells:
49 | for orbit in shell.orbits:
50 | for satellite in orbit.satellites:
51 | satellite.ISL.clear() # clear satellite ISL
52 |
53 |
54 | # Function : switch the connection mode
55 | # Parameters :
56 | # plugin_name : the name of the new connection mode
57 | def set_connection_mode(self , plugin_name):
58 | self.current_connection_mode = plugin_name # set the current connection mode to the specified mode
59 | #print("\t\t\tThe current constellation connection mode has been switched to " + plugin_name)
60 |
61 |
62 | # Function : execute constellation connection mode
63 | # Parameters :
64 | # dT : the time slot
65 | def execute_connection_policy(self , constellation , dT):
66 | self.clear_ISL(constellation) # clear all existing ISLs
67 | function = self.plugins[self.current_connection_mode]
68 | function(constellation , dT) # go to execute the corresponding connection mode function
69 |
70 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_connectivity/connectivity_plugin/__pycache__/bent_pipe.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_connectivity/connectivity_plugin/__pycache__/bent_pipe.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_connectivity/connectivity_plugin/__pycache__/positive_Grid.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_connectivity/connectivity_plugin/__pycache__/positive_Grid.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_connectivity/connectivity_plugin/bent_pipe.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/03
6 |
7 | Function : This script is used to simulate the constellation working in bent-pipe mode, and there is no ISL between
8 | satellites.
9 |
10 | Specific implementation: The constellation has generated various shells, orbits, and satellites during initialization.
11 | There is no ISL between satellites in this mode, so there is nothing to do here, just return
12 | directly.
13 |
14 | '''
15 |
16 | def bent_pipe(constellation = None , dT = None):
17 | pass
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_energy/energy_plugin_manager.py:
--------------------------------------------------------------------------------
1 | """
2 | Author : zhifenghan
3 |
4 | Date : 2025/05/09
5 |
6 | Function : This class manages energy consumption modeling plugins for satellite constellation simulations.
7 | It dynamically loads different energy consumption models, provides an interface to switch between
8 | them, and executes the selected energy calculation policy with configurable communication
9 | parameters to accurately model satellite power consumption.
10 |
11 | """
12 |
13 | import os
14 | import importlib
15 |
16 | class energy_plugin_manager:
17 | def __init__(self):
18 | self.plugins = {}
19 | package_name = "src.XML_constellation.constellation_energy.energy_plugin"
20 | plugins_path = package_name.replace(".", os.path.sep)
21 | for plugin_name in os.listdir(plugins_path):
22 | if plugin_name.endswith(".py"):
23 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
24 | plugin = importlib.import_module(package_name + "." + plugin_name)
25 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
26 | function = getattr(plugin, plugin_name)
27 | self.plugins[plugin_name] = function
28 |
29 | self.current_energy_model = "communication_link"
30 |
31 |
32 | def set_energy_model(self, plugin_name):
33 | if plugin_name in self.plugins:
34 | self.current_energy_model = plugin_name
35 | else:
36 | raise ValueError(f"Plugin {plugin_name} not found!")
37 |
38 |
39 | def execute_energy_policy(self, constellation, time_slot, gsl_transmitter_idle=40, isl_transmitter_idle=10,
40 | gsl_transmitter_active=200, isl_transmitter_active=50, gsl_transmitter_w=0.01,
41 | isl_transmitter_w=0.0025, gsl_receiver_idle=40, isl_receiver_idle=10,
42 | gsl_receiver_active=100, isl_receiver_active=25, gsl_receiver_w=0.008,
43 | isl_receiver_w=0.002, tail_energy_time=2):
44 |
45 | function = self.plugins[self.current_energy_model]
46 |
47 | return function(constellation, time_slot, gsl_transmitter_idle, isl_transmitter_idle,
48 | gsl_transmitter_active, isl_transmitter_active, gsl_transmitter_w,
49 | isl_transmitter_w, gsl_receiver_idle, isl_receiver_idle,
50 | gsl_receiver_active, isl_receiver_active, gsl_receiver_w,
51 | isl_receiver_w, tail_energy_time)
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/ISL.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This file defines the inter-satellite link class ISL, which is the base class for all ISLs in this project.
8 | ISL is responsible for connecting two satellites and has no directionality, so there is no need to
9 | distinguish between source and destination satellites.
10 |
11 | '''
12 |
13 |
14 | class ISL:
15 | def __init__(self , satellite1 , satellite2 , data_rate=5, frequency_band =5, capacity =5):
16 | self.satellite1 = satellite1.id # the id of the first satellite, int type
17 | self.satellite2 = satellite2.id # the id of the second satellite, int type
18 | # the distance between the two satellites connected by ISL, the unit is kilometers km. This parameter is of
19 | # list type because it needs to store the distances of different timeslots.
20 | self.distance = []
21 | # the delay between the two satellites connected by ISL, in seconds, this parameter is of list type because it
22 | # needs to store the delay time of different timeslots.
23 | self.delay = []
24 | # data transfer rate (Gbps)
25 | self.data_rate = data_rate
26 | # laser band
27 | self.frequency_band = frequency_band
28 | # the capacity of ISL
29 | self.capacity = capacity
30 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/POP.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/07
6 |
7 | Function : This file defines the POP point class. The POP point is an entrance and exit that must be passed through
8 | before the satellite transmits the signal to the ground station GS before accessing the ground Internet.
9 |
10 | '''
11 |
12 | class POP:
13 | def __init__(self , longitude, latitude , POP_name=None):
14 | self.POP_name = POP_name # the name of POP
15 | self.longitude = longitude # the longitude of POP
16 | self.latitude = latitude # the latitude of POP
17 |
18 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/ISL.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/ISL.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/POP.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/POP.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/constellation.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/constellation.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/ground_station.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/ground_station.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/orbit.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/orbit.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/satellite.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/satellite.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/shell.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/shell.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/__pycache__/user.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_entity/__pycache__/user.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/constellation.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This file defines the constellation class, including the name of the constellation, and some parameters of
8 | the constellation (such as how many layers of shells there are, how many satellites there are, how many
9 | orbits there are, etc.)
10 |
11 | '''
12 |
13 | class constellation:
14 | def __init__(self , constellation_name , number_of_shells , shells):
15 | self.constellation_name = constellation_name # constellation name
16 | self.number_of_shells = number_of_shells # the number of shells contained in the constellation
17 | # which shells are included in the constellation? it is a list type object, which stores shell class objects.
18 | self.shells = shells
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/ground_station.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This file defines the ground station GS class. GS is located on the earth's surface. When instantiating GS,
8 | the longitude and latitude must be passed in.
9 |
10 | '''
11 |
12 | class ground_station:
13 | def __init__(self , longitude, latitude , description = None , frequency=None , antenna_count = None ,
14 | uplink_GHz = None , downlink_GHz = None):
15 | self.longitude = longitude # the longitude of GS
16 | self.latitude = latitude # the latitude of GS
17 | self.description = description # the description of GS's position
18 | self.frequency = frequency # the frequency of GS, such as Ka,E and so on
19 | self.antenna_count = antenna_count # the number of antenna of GS
20 | self.uplink_GHz = uplink_GHz # the uplink GHz of GS
21 | self.downlink_GHz = downlink_GHz # the downlink GHz of GS
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/orbit.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This file defines the orbit class, which is used to describe the relevant parameters of a satellite orbit.
8 | Considering the ellipse here, five parameters are needed to uniquely determine an orbit: orbit semi-major
9 | axis, orbit inclination, ascending node right ascension, eccentricity, and perigee amplitude. horn
10 |
11 | '''
12 | import math
13 | from poliastro.bodies import Earth
14 | from poliastro.twobody import Orbit
15 | from astropy import units as u
16 |
17 |
18 |
19 | class orbit:
20 | def __init__(self , a , ecc , inc , raan , argp):
21 | self.a = a * u.km # the semi-major axis of the orbit in kilometers km
22 | self.ecc = ecc * u.one # orbital eccentricity
23 | self.inc = inc * u.deg # the inclination of the orbit in degrees
24 | self.raan = raan * u.deg # orbit ascending node right ascension
25 | self.argp = argp * u.deg # perigee argument in degrees
26 | # # calculate orbital period (unit: s)
27 | self.orbit_cycle = 2 * math.pi * math.sqrt((a*1000) ** 3 / (6.67430e-11 * 5.972e24))
28 | # actual satellite orbit
29 | self.satellite_orbit = Orbit.from_classical(
30 | Earth,
31 | a=self.a,
32 | ecc=self.ecc,
33 | inc=self.inc,
34 | raan=self.raan,
35 | argp=self.argp,
36 | # True periapsis angle is used to describe the satellite. Here is the generated orbit. This parameter
37 | # has no effect and only takes up space.
38 | nu=0 * u.deg
39 | )
40 | # a list type field is used to store satellites in the orbit and stores satellite objects.
41 | self.satellites = []
42 |
43 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/satellite.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This file defines the satellite class satellite, which is the base class for all satellites in this project.
8 | Determining the satellite's position in orbit requires parameters such as longitude, latitude, distance from
9 | the earth's surface, true periapsis angle, etc.
10 |
11 | '''
12 |
13 | class satellite:
14 | def __init__(self , nu , orbit , true_satellite):
15 | # longitude (degree), because the satellite is constantly moving, there are many longitudes. Use the list type
16 | # to store all the longitudes of the satellite.
17 | self.longitude = []
18 | # latitude (degree), because the satellite is constantly moving, there are many latitudes. Use the list type
19 | # to store all the latitudes of the satellite.
20 | self.latitude = []
21 | # altitude (km), because the altitude is constantly moving, there are many altitudes. Use the list type
22 | # to store all the altitudes of the satellite.
23 | self.altitude = []
24 | # the current orbit of the satellite
25 | self.orbit = orbit
26 | # list type attribute, which stores the current satellite and which satellites have established ISL, stores
27 | # the ISL object
28 | self.ISL = []
29 | # True periapsis angle is a parameter that describes the position of an object in orbit. It represents the
30 | # angle of the object's position in orbit relative to the perigee. For different times, the value of the true
31 | # periapsis angle keeps changing as the object moves in its orbit.
32 | self.nu = nu
33 | # the id number of the satellite, which is the number of the satellite in the shell where it is located. If the
34 | # constellation has multiple shells, the id of each satellite is the number of the shell in which it is located.
35 | # Each shell is numbered starting from 1. The ID number is initially -1, and the user does not need to specify
36 | # it manually.
37 | self.id = -1
38 | # real satellite object created with sgp4 and skyfield models
39 | self.true_satellite = true_satellite
40 |
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/shell.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/08/24
6 |
7 | Function : This file defines one layer of the constellation (that is, the shell). The fields in the class describe some
8 | information about the shell, including the height of the shell, the number of satellites it contains, the
9 | number of orbits it contains, etc.
10 |
11 | '''
12 |
13 | class shell:
14 | def __init__(self , altitude , number_of_satellites , number_of_orbits , inclination , orbit_cycle ,
15 | number_of_satellite_per_orbit , phase_shift , shell_name):
16 | self.altitude = altitude # height of shell (km)
17 | self.number_of_satellites = number_of_satellites # the number of satellites included in this shell
18 | self.number_of_orbits = number_of_orbits # the number of orbits contained in this shell
19 | self.inclination = inclination # the inclination angle of the orbit in this shell
20 | self.orbit_cycle = orbit_cycle # the orbital period of this layer’s shell
21 | # the number of satellites per orbit in this layer’s shell
22 | self.number_of_satellite_per_orbit = number_of_satellite_per_orbit
23 | self.phase_shift = phase_shift # phase shift, used when generating satellites
24 | # the name of this layer's shell, name format: shell+number, such as: "shell1", "shell2", etc.
25 | self.shell_name = shell_name
26 | # a list type object is used to store which orbits are included in the shell of this layer. It stores orbit
27 | # objects.
28 | self.orbits = []
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_entity/user.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/07
6 |
7 | Function : This file defines the user terminal class, the source endpoint and destination endpoint that need to be
8 | specified in communication, and these endpoints are the instantiation objects of this class. User terminals
9 | are all located on the surface of the earth, and the longitude and latitude must be passed in when
10 | instantiating this class.
11 |
12 | '''
13 |
14 | class user:
15 | def __init__(self , longitude, latitude , user_name=None):
16 | self.user_name = user_name # the name of user
17 | self.longitude = longitude # the longitude of user
18 | self.latitude = latitude # the latitude of user
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/bandwidth.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/bandwidth.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/betweeness.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/betweeness.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/coverage.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/coverage.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/delay.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/exists_ISL/__pycache__/delay.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/exists_ISL/betweeness.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/10/14
6 |
7 | Function : Calculate the betweeness value of each satellite in a satellite constellation shell
8 |
9 | '''
10 | import networkx as nx
11 | import h5py
12 | import numpy as np
13 |
14 | # Parameters:
15 | # constellation_name : the name of the constellation, and the parameter type is a string, such as "Starlink"
16 | # sh : a shell class object, representing a shell in the constellation
17 | # t : a certain time slot (timeslot)
18 | def betweeness(constellation_name , sh , t=1):
19 | file_path = "data/XML_constellation/" + constellation_name + ".h5" # h5 file path and name
20 | # read the delay matrix of the shell layer of the constellation constellation at time t
21 | with h5py.File(file_path, 'r') as file:
22 | # access the existing first-level subgroup delay group
23 | delay_group = file['delay']
24 | # access the existing secondary subgroup 'shell'+str(count) subgroup
25 | current_shell_group = delay_group[sh.shell_name]
26 | # read the data set
27 | delay = np.array(current_shell_group['timeslot' + str(t)]).tolist()
28 |
29 | G = nx.Graph() # create an undirected graph object named G, which is empty at first, with no nodes and edges.
30 | satellite_nodes = []
31 | for i in range(1, len(delay), 1):
32 | satellite_nodes.append("satellite_" + str(i))
33 | G.add_nodes_from(satellite_nodes) # add nodes to an undirected graph
34 |
35 | satellite_edges = []
36 | for i in range(1, len(delay), 1):
37 | for j in range(i + 1, len(delay), 1):
38 | if delay[i][j] > 0:
39 | satellite_edges.append(("satellite_" + str(i), "satellite_" + str(j), delay[i][j]))
40 | # add an edge to an undirected graph. The weight of the edge is the value in the delay matrix.
41 | G.add_weighted_edges_from(satellite_edges)
42 | # calculate the betweenness centrality value of each satellite
43 | score = nx.betweenness_centrality(G)
44 | bet = []
45 | for item in score.keys():
46 | bet.append(score[item])
47 | return bet
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/not_exists_ISL/__pycache__/bandwidth.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/not_exists_ISL/__pycache__/bandwidth.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/not_exists_ISL/__pycache__/coverage.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/not_exists_ISL/__pycache__/coverage.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_evaluation/not_exists_ISL/__pycache__/delay.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_evaluation/not_exists_ISL/__pycache__/delay.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_highsurvivability/__pycache__/damage_model_plugin_manager.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_highsurvivability/__pycache__/damage_model_plugin_manager.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_highsurvivability/damage_model_plugin/__pycache__/natural_failure_satellites.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_highsurvivability/damage_model_plugin/__pycache__/natural_failure_satellites.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_highsurvivability/damage_model_plugin/__pycache__/sunstorm_damaged_satellites.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_highsurvivability/damage_model_plugin/__pycache__/sunstorm_damaged_satellites.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_highsurvivability/damage_model_plugin_manager.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/14
6 |
7 | Function : Constellation damage model plug-in manager, used to manage all constellation damage models. Write a
8 | constellation damage model plug-in manager to store all damage models as plug-ins, such as satellite
9 | natural aging damage, solar storm concentrated damage and other models. If users want to implement
10 | their own damage models, they only need to write the script themselves and put it in the specified
11 | location. In this way, a unified interface is formed to manage all damage models, and this interface
12 | is the Constellation Damage Model Plug-in Manager , it treats each damage model as a plug-in, which
13 | users can implement and use as needed.
14 |
15 | '''
16 | import os
17 | import importlib
18 |
19 | class damage_model_plugin_manager:
20 | def __init__(self):
21 | # constellation damage model plug-in dictionary stores all constellation damage model plug-ins in this project.
22 | # The key of the dictionary is the function name of the damaged model, and the value is the function
23 | # corresponding to the damaged model.
24 | self.plugins = {}
25 |
26 |
27 | # traverse this folder to obtain the names of all damaged model plug-ins and store them in the
28 | # self.plugins dictionary.
29 | package_name = "src.XML_constellation.constellation_highsurvivability.damage_model_plugin"
30 | plugins_path = package_name.replace(".", os.path.sep) # the path where the plug-in is stored
31 | for plugin_name in os.listdir(plugins_path):
32 | if plugin_name.endswith(".py"):
33 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
34 | plugin = importlib.import_module(package_name + "." + plugin_name)
35 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
36 | function = getattr(plugin, plugin_name)
37 | self.plugins[plugin_name] = function
38 | # set the damage mode used by the current damage model plug-in manager. The default is the solar storm
39 | # concentrated damage model.
40 | self.current_damage_model = "sunstorm_damaged_satellites"
41 |
42 | # switch the damaged model
43 | # Parameter meaning: plugin_name is the name of the new damaged model
44 | def set_damage_model(self, plugin_name):
45 | self.current_damage_model = plugin_name # sets the current damage model to the specified model
46 | print("The current constellation damage model has been switched to " + plugin_name)
47 |
48 |
49 | # Function : execute the constellation damage model and start destroying the constellation
50 | # according to the specified pattern
51 | # Parameters:
52 | # constellation : the constellation that needs to be destroyed by the solar storm and is a constellation class object.
53 | # sh : the shell that needs to be destroyed by the solar storm and is a shell class object
54 | # num_of_damaged_satellites : the number of randomly destroyed satellites. If the value is less than 1, it is the
55 | # number of satellites destroyed as a percentage of the total number; if the value is
56 | # greater than 1, it is the number of satellites that need to be destroyed.
57 | # dT : how often a timeslot is recorded
58 | # satrt_satellite_id : the id of the most central satellite in a group of satellites to be destroyed. If
59 | # satrt_satellite_id is -1, it means that the id of the center satellite of the destroyed group is
60 | # not specified, but a randomly generated one.
61 | # Return Value : returns the constellation name after num_of_damaged_satellites satellites have been destroyed
62 | def execute_damage_model(self , constellation , sh , num_of_damaged_satellites , dT , satrt_satellite_id = -1):
63 | function = self.plugins[self.current_damage_model]
64 | constellation_copy = function(constellation , sh , num_of_damaged_satellites , dT , satrt_satellite_id)
65 | return constellation_copy
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_routing/__pycache__/routing_policy_plugin_manager.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_routing/__pycache__/routing_policy_plugin_manager.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_routing/routing_policy_plugin/__pycache__/least_hop_path.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_routing/routing_policy_plugin/__pycache__/least_hop_path.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_routing/routing_policy_plugin/__pycache__/second_shortest_path.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_routing/routing_policy_plugin/__pycache__/second_shortest_path.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_routing/routing_policy_plugin/__pycache__/shortest_path.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_routing/routing_policy_plugin/__pycache__/shortest_path.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_routing/routing_policy_plugin_manager.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/15
6 |
7 | Function : Constellation routing policy plug-in manager is used to manage all constellation routing policy models.
8 | Write a constellation routing policy plug-in manager to store all routing strategies as plug-ins, such as
9 | shortest path routing, least hop routing and other models. If users want to implement their own routing
10 | model, they only need to write the script themselves and put it in the specified location. In this way,
11 | a unified interface is formed to manage all routing policy models, and this interface is the management of
12 | the constellation routing model plug-in. The router treats each routing model as a plug-in, which users can
13 | implement and use as needed. Each routing strategy is plug-in-based, defining a unified interface for
14 | routing strategies and implementing three methods: shortest path routing, second-shortest path routing and
15 | least hop routing. If you want to simulate other routing strategies in the future, you only need to write
16 | your own script according to the interface specifications. All constellation routing policy model plug-ins
17 | are located in the src/constellation_routing/routing_policy_plugin directory. To implement a new
18 | constellation routing policy model, users only need to write their own kits according to the agreed
19 | interface specifications and put them in this path.
20 |
21 | '''
22 | import os
23 | import importlib
24 |
25 |
26 | class routing_policy_plugin_manager:
27 | def __init__(self):
28 | # constellation routing policy model plug-in dictionary stores all constellation routing model plug-ins in this
29 | # project. The key of the dictionary is the function name of the routing model, and the value is the function
30 | # corresponding to the routing model.
31 | self.plugins = {}
32 | # the following code block is used to traverse the src/constellation_routing/routing_policy_plugin folder, which
33 | # stores the py files of all routing models.
34 |
35 |
36 | # traverse this folder to obtain the names of all routing model plug-ins and store them in the self.plugins
37 | # collection.
38 | package_name = "src.XML_constellation.constellation_routing.routing_policy_plugin"
39 | plugins_path = package_name.replace(".", os.path.sep) # the path where the plug-in is stored
40 | for plugin_name in os.listdir(plugins_path):
41 | if plugin_name.endswith(".py"):
42 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
43 | plugin = importlib.import_module(package_name + "." + plugin_name)
44 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
45 | function = getattr(plugin, plugin_name)
46 | self.plugins[plugin_name] = function
47 | # set the routing mode used by the current routing policy model plug-in manager. The shortest path routing model
48 | # is used by default.
49 | self.current_routing_policy = "shortest_path"
50 |
51 | # switch routing policy
52 | # Parameters:
53 | # plugin_name : the name of the new routing policy
54 | def set_routing_policy(self, plugin_name):
55 | self.current_routing_policy = plugin_name # set the current routing policy to the specified model
56 | #print("\t\t\tThe current constellation routing policy has been switched to " + plugin_name)
57 |
58 |
59 | # Function : implement corresponding routing policies
60 | # Parameters:
61 | # constellation_name : the name of the constellation, and the parameter type is a string, such as "Starlink"
62 | # source : the source ground station
63 | # target : the target ground station
64 | # t : a certain time slot (timeslot)
65 | # sh : a shell class object, representing a shell in the constellation
66 | def execute_routing_policy(self , constellation_name , source , target , sh , t=1):
67 | function = self.plugins[self.current_routing_policy]
68 | target_routing_path = function(constellation_name , source , target , sh , t)
69 | return target_routing_path
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_traffic/__pycache__/traffic_plugin_manager.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_traffic/__pycache__/traffic_plugin_manager.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_traffic/traffic_plugin/__pycache__/positive_grid_icarus.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_traffic/traffic_plugin/__pycache__/positive_grid_icarus.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_traffic/traffic_plugin/__pycache__/positive_grid_traffic.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/XML_constellation/constellation_traffic/traffic_plugin/__pycache__/positive_grid_traffic.cpython-310.pyc
--------------------------------------------------------------------------------
/src/XML_constellation/constellation_traffic/traffic_plugin_manager.py:
--------------------------------------------------------------------------------
1 | """
2 | Author : zhifenghan
3 |
4 | Date : 2025/05/09
5 |
6 | Function : This class manages traffic generation plugins for satellite constellation simulations.
7 | It dynamically loads traffic model plugins, provides an interface to switch between
8 | different traffic models, and executes the selected traffic generation policy on
9 | the constellation network.
10 | """
11 |
12 | import os
13 | import importlib
14 |
15 | class traffic_plugin_manager:
16 | def __init__(self):
17 | # Store all traffic generation plugins in this dictionary
18 | self.plugins = {}
19 | # Traverse this folder to obtain all traffic model plugins
20 | package_name = "src.XML_constellation.constellation_traffic.traffic_plugin"
21 | plugins_path = package_name.replace(".", os.path.sep)
22 | for plugin_name in os.listdir(plugins_path):
23 | if plugin_name.endswith(".py"):
24 | plugin_name = plugin_name[:-3] # remove the file extension ".py"
25 | plugin = importlib.import_module(package_name + "." + plugin_name)
26 | if hasattr(plugin, plugin_name) and callable(getattr(plugin, plugin_name)):
27 | function = getattr(plugin, plugin_name)
28 | self.plugins[plugin_name] = function
29 |
30 | # Defualt to the positive_grid_traffic model
31 | self.current_traffic_model = "positive_grid_traffic"
32 |
33 | # Switcch the traffic generation model
34 | def set_traffic_model(self, plugin_name):
35 | if plugin_name in self.plugins:
36 | self.current_traffic_model = plugin_name
37 | else:
38 | raise ValueError(f"Plugin {plugin_name} not found!")
39 | # print("The current constellation traffic model has been switched to " + plugin_name)
40 |
41 | # Execute the corresponding traffic generation policy
42 | def execute_traffic_policy(self, constellation, time_slot,
43 | minimum_elevation=25, isl_capacity=20480,
44 | uplink_capacity=4096, downlink_capacity=4096,
45 | link_utilization_ratio=0.9, flow_size=0.5):
46 |
47 | function = self.plugins[self.current_traffic_model]
48 |
49 | return function(constellation, time_slot,
50 | minimum_elevation, isl_capacity,
51 | uplink_capacity, downlink_capacity,
52 | link_utilization_ratio, flow_size)
53 |
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/__pycache__/constellation_configuration.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_TLE/__pycache__/constellation_configuration.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/__pycache__/download_TLE_data.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_TLE/__pycache__/download_TLE_data.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/__pycache__/get_satellite_position.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_TLE/__pycache__/get_satellite_position.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/__pycache__/satellite_to_orbit_mapping.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_TLE/__pycache__/satellite_to_orbit_mapping.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/__pycache__/satellite_to_shell_mapping.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_TLE/__pycache__/satellite_to_shell_mapping.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/download_TLE_data.py:
--------------------------------------------------------------------------------
1 | '''
2 | Author : yunanhou
3 |
4 | Date : 2023/11/26
5 |
6 | Function : Download the current day's TLE data from the CelesTrak website
7 | https://celestrak.org/NORAD/elements/index.php?FORMAT=2le
8 |
9 | Note: Note: These two download TLE data in two formats: 2LE and JSON.
10 | The standard TLE data format is as follows:
11 |
12 | STARLINK-1007
13 | 1 44713U 19074A 23329.35222268 .00001777 00000+0 13823-3 0 9990
14 | 2 44713 53.0554 336.5953 0001540 82.5266 277.5898 15.06386495222847
15 |
16 | The 2LE format omits the first line of standard TLE data and only retains the second and third lines, as follows:
17 |
18 | 1 44713U 19074A 23329.35222268 .00001777 00000+0 13823-3 0 9990
19 | 2 44713 53.0554 336.5953 0001540 82.5266 277.5898 15.06386495222847
20 |
21 | JSON format is the data after parsing standard TLE data into JSON format, as follows:
22 |
23 | [
24 | {
25 | "OBJECT_NAME": "STARLINK-1007",
26 | "OBJECT_ID": "2019-074A",
27 | "EPOCH": "2023-11-25T08:27:12.039552",
28 | "MEAN_MOTION": 15.06386495,
29 | "ECCENTRICITY": 0.000154,
30 | "INCLINATION": 53.0554,
31 | "RA_OF_ASC_NODE": 336.5953,
32 | "ARG_OF_PERICENTER": 82.5266,
33 | "MEAN_ANOMALY": 277.5898,
34 | "EPHEMERIS_TYPE": 0,
35 | "CLASSIFICATION_TYPE": "U",
36 | "NORAD_CAT_ID": 44713,
37 | "ELEMENT_SET_NO": 999,
38 | "REV_AT_EPOCH": 22284,
39 | "BSTAR": 0.00013823,
40 | "MEAN_MOTION_DOT": 1.777e-5,
41 | "MEAN_MOTION_DDOT": 0
42 | },
43 | ...
44 | ]
45 |
46 | Since h5 files cannot directly store data in JSON format, each JSON object needs to be converted into a string
47 | first and then stored in the h5 file. When reading data, the string needs to be converted into JSON before it can
48 | be used.
49 | '''
50 | import requests
51 | import os
52 | import h5py
53 | from datetime import datetime
54 | import json
55 |
56 |
57 | # download the current day's TLE data from the CelesTrak website
58 | def download_TLE_data(constellation_name):
59 | # h5 file path to save TLE data
60 | file_path = 'config/TLE_constellation/' + constellation_name + '/tle.h5'
61 | if not os.path.exists(file_path):
62 | with h5py.File(file_path, 'a') as file:
63 | pass
64 | # TLE data url
65 | url1 = "https://celestrak.org/NORAD/elements/gp.php?GROUP=" + constellation_name + "&FORMAT=2le"
66 | url2 = "https://celestrak.org/NORAD/elements/gp.php?GROUP=" + constellation_name + "&FORMAT=json"
67 | try:
68 | # send HTTP GET request
69 | response1 = requests.get(url1)
70 | # check if the request was successful
71 | response1.raise_for_status()
72 | # get web page TLE data and split the str by '\n'
73 | TLE = response1.text.split('\n')
74 | # delete the last row because it is a blank row with no data
75 | TLE.pop()
76 |
77 | response2 = requests.get(url2)
78 | if response2.status_code == 200:
79 | json_TLE = response2.json()
80 | # convert each JSON object to a string
81 | json_TLE = [json.dumps(item) for item in json_TLE]
82 |
83 | with h5py.File(file_path, 'a') as file:
84 | # get the current date and format it into 'yyyymmdd' format
85 | current_date = datetime.now()
86 | formatted_date = current_date.strftime('%Y%m%d')
87 | # if the group named with formatted_date does not exist, create a new group with the name
88 | # formatted_date, and write the obtained TLE data into the group.
89 | if file.get(formatted_date) is None:
90 | file.create_group(formatted_date)
91 | file[formatted_date].create_dataset(formatted_date + "-2LE", data=TLE)
92 | file[formatted_date].create_dataset(formatted_date + "-json", data=json_TLE)
93 | print("\t\t\t" + constellation_name + '\'s TLE data download was successful on ' + formatted_date + ' !')
94 | else:
95 | pass
96 | except requests.exceptions.RequestException as e:
97 | print(f"\t\t\tWhen downloading TLE data, an error occurred in the web page request: {e}")
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/get_satellite_position.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/11/26
6 |
7 | Function : This script is used to parse the longitude, latitude and altitude position information of the satellite at
8 | a specified time from TLE data.
9 |
10 | '''
11 | from skyfield.api import load, EarthSatellite
12 |
13 | # analyze the satellite's latitude, longitude and altitude position based on TLE data and specified time
14 | # Parameter :
15 | # TLE : The TLE data of the constellation can be downloaded from the website
16 | # https://celestrak.org/NORAD/elements/index.php?FORMAT=2le. The parameter type is list, and each element in the
17 | # list is a row of TLE data, and the TLE data format is 2LE
18 | # year, month, day, hour, minute, second : to calculate the time corresponding to the satellite position
19 | def get_satellite_position(TLE, year, month, day, hour, minute, second):
20 | # load ephemeris data
21 | planets = load('de421.bsp')
22 | ts = load.timescale()
23 | # specify a specific UTC time point
24 | t = ts.utc(year, month, day, hour, minute, second)
25 | # parse TLE data and obtain satellite position information
26 | num_satellites = len(TLE) // 2
27 | satellite_positions = []
28 | for i in range(0, len(TLE), 2):
29 | tle_line1 = TLE[i].strip()
30 | tle_line2 = TLE[i + 1].strip()
31 | # create satellite object
32 | satellite = EarthSatellite(tle_line1, tle_line2, 'SAT', ts)
33 | # calculate satellite position
34 | topocentric = satellite.at(t)
35 | subpoint = topocentric.subpoint()
36 | # get the geographical coordinates of a satellite (longitude, latitude, altitude)
37 | longitude = subpoint.longitude.degrees
38 | latitude = subpoint.latitude.degrees
39 | altitude = subpoint.elevation.km
40 | satellite_positions.append((longitude, latitude, altitude))
41 | return satellite_positions
--------------------------------------------------------------------------------
/src/constellation_generation/by_TLE/satellite_to_orbit_mapping.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/02
6 |
7 | Function : The orbits within a shell are derived based on a clustering algorithm and the satellites are assigned to
8 | these orbits.
9 |
10 | Specifically, before executing this script, the corresponding relationship between satellites and shells has
11 | been established, but the relationship between satellites and orbit points has not yet been established. The
12 | function of this script is to establish the corresponding relationship between satellites and orbit.
13 |
14 | The main function of the script needs to pass in a shell class object, and then cluster the raan of each
15 | satellite in the shell object to obtain several orbits, and then assign all satellites in the shell to these
16 | orbits.
17 |
18 | '''
19 | import jenkspy
20 | import src.TLE_constellation.constellation_entity.orbit as ORBIT
21 | import matplotlib.pyplot as plt
22 |
23 | # Parameter :
24 | # shells : a collection of shell objects that have established corresponding relationships
25 | # Return Value :
26 | # after the function is executed, the mapping relationship between satellite, orbit, and shell has been established
27 | # without any return value.
28 | def satellite_to_orbit_mapping(shells):
29 | for sh in shells:
30 | # extract the raan of all satellites in sh
31 | raans = []
32 | for sat in sh.satellites:
33 | raans.append(sat.tle_json["RA_OF_ASC_NODE"])
34 | raans = sorted(raans)
35 |
36 | plt.plot(raans)
37 | plt.ylabel('RAANS')
38 | plt.show()
39 |
40 | orbits_number = int(input('\t\t\tPlease enter the number of orbits (integer) based on the raan distribution result of '
41 | 'the line chart : '))
42 | breaks = jenkspy.jenks_breaks(values = raans, n_classes = orbits_number)
43 | orbit_raans = [(breaks[i], breaks[i + 1]) for i in range(len(breaks) - 1)]
44 | for ra_index, ra in enumerate(orbit_raans):
45 | lower_bound = ra[0]
46 | upper_bound = ra[1]
47 | orbit = ORBIT.orbit(shell=sh , raan_lower_bound=lower_bound , raan_upper_bound=upper_bound)
48 | for sat in sh.satellites:
49 | if ra_index > 0:
50 | if sat.tle_json["RA_OF_ASC_NODE"] > lower_bound and sat.tle_json["RA_OF_ASC_NODE"] <= upper_bound:
51 | sat.orbit = orbit
52 | orbit.satellites.append(sat)
53 | if ra_index == 0:
54 | if sat.tle_json["RA_OF_ASC_NODE"] >= lower_bound and sat.tle_json["RA_OF_ASC_NODE"] <= upper_bound:
55 | sat.orbit = orbit
56 | orbit.satellites.append(sat)
57 |
58 | sh.orbits.append(orbit)
--------------------------------------------------------------------------------
/src/constellation_generation/by_XML/__pycache__/constellation_configuration.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_XML/__pycache__/constellation_configuration.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_XML/__pycache__/orbit_configuration.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_XML/__pycache__/orbit_configuration.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_duration/__pycache__/constellation_configuration.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_duration/__pycache__/constellation_configuration.cpython-310.pyc
--------------------------------------------------------------------------------
/src/constellation_generation/by_duration/__pycache__/orbit_configuration.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/constellation_generation/by_duration/__pycache__/orbit_configuration.cpython-310.pyc
--------------------------------------------------------------------------------
/src/standalone_module/__pycache__/polar_constellation_coverage.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/standalone_module/__pycache__/polar_constellation_coverage.cpython-310.pyc
--------------------------------------------------------------------------------
/src/standalone_module/__pycache__/satellite_orbital_period.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/standalone_module/__pycache__/satellite_orbital_period.cpython-310.pyc
--------------------------------------------------------------------------------
/src/standalone_module/__pycache__/satellite_redundancy.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/standalone_module/__pycache__/satellite_redundancy.cpython-310.pyc
--------------------------------------------------------------------------------
/src/standalone_module/__pycache__/satellite_visibility_time.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpaceNetLab/StarPerf_Simulator/118f2750b1ebd2b4e68a28b39583f776213f731e/src/standalone_module/__pycache__/satellite_visibility_time.cpython-310.pyc
--------------------------------------------------------------------------------
/src/standalone_module/satellite_orbital_period.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | Author: yunanhou
4 |
5 | Date: 2024/03/17
6 |
7 | Function: This script is used to calculate the orbital period of a satellite.
8 |
9 | Input : Satellite orbital altitude (i.e., the distance from the satellite to the ground, in kilometers)
10 |
11 | Output : The orbital period of the satellite (i.e., the time it takes for the satellite to complete one orbit around the Earth, in seconds)
12 |
13 | """
14 | import math
15 |
16 |
17 | # Parameters :
18 | # alitude : the height of a satellite's orbit above the earth's surface, in kilometers
19 | def satellite_orbital_period(alitude):
20 | # the Earth's gravitational constant (unit: m^3/kg*s^2)
21 | G = 6.67430e-11
22 | # mass of the Earth (unit: kg)
23 | M = 5.97219e24
24 | # radius of the earth (km)
25 | R = 6371
26 | # calculate the orbital period of the satellite (unit: seconds)
27 | T = round(2 * math.pi * math.sqrt(math.pow((R+alitude)*1000, 3) / (G * M)))
28 | return T
29 |
30 |
31 | print(satellite_orbital_period(1200))
--------------------------------------------------------------------------------
/src/standalone_module/satellite_visibility_time.py:
--------------------------------------------------------------------------------
1 | '''
2 |
3 | Author : yunanhou
4 |
5 | Date : 2023/12/25
6 |
7 | Function : This script is used to calculate the length of time that a user on the ground can see the satellite.
8 | The lowest elevation angle that the user can see of the satellite is θ, the orbital height of the satellite
9 | is h (unit: kilometers), and the radius of the earth is R (unit: kilometers). Calculate the length of time
10 | from when the user can see the satellite to when the user cannot see the satellite based on the given parameters.
11 |
12 | '''
13 | import math
14 |
15 |
16 | # Parameters:
17 | # θ : the lowest elevation angle at which the user can see the satellite (unit: degrees)
18 | # h : the height of a satellite's orbit above the earth's surface, in kilometers
19 | def satellite_visibility_time(θ , h):
20 | # the Earth's gravitational constant (unit: m^3/kg*s^2)
21 | G = 6.67430e-11
22 | # mass of the Earth (unit: kg)
23 | M = 5.97219e24
24 | # radius of the earth (km)
25 | R = 6371
26 | # calculate the orbital period of the satellite (unit: seconds)
27 | T = 2 * math.pi * math.sqrt(math.pow((R+h)*1000, 3) / (G * M))
28 | # convert θ from angle to radian
29 | θ = math.radians(θ)
30 | # calculate the time the user can see the satellite
31 | t = 1.0*T/math.pi*(math.pi/2-θ-math.asin(R/(R+h)*math.cos(θ)))
32 |
33 | return t
34 |
35 |
36 | if __name__ == '__main__':
37 | print(satellite_visibility_time(25, 550))
--------------------------------------------------------------------------------