-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgroup_example.py
More file actions
31 lines (26 loc) · 1004 Bytes
/
group_example.py
File metadata and controls
31 lines (26 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import numpy as np
from CDMA.station import Station
from CDMA.medium import Medium
station0 = Station("A", np.array([-1, -1, -1, +1, +1, -1, +1, +1]), {}, [1, 1, 1, 1, 1, 1, 1, 1])
station1 = Station("B", np.array([-1, -1, +1, -1, +1, +1, +1, -1]), {}, [0, 0, 0, 0, 0, 0, 0, 0])
station2 = Station("C", np.array([-1, +1, -1, +1, +1, +1, -1, -1]), {}, [1, 0, 1, 0, 1, 0, 1, 0])
station0.other_stations = {
station1: np.array([-1, -1, +1, -1, +1, +1, +1, -1]),
station2: np.array([-1, +1, -1, +1, +1, +1, -1, -1])
}
station1.other_stations = {
station0: np.array([-1, -1, -1, +1, +1, -1, +1, +1]),
station2: np.array([-1, +1, -1, +1, +1, +1, -1, -1])
}
station2.other_stations = {
station0: np.array([-1, -1, -1, +1, +1, -1, +1, +1]),
station1: np.array([-1, -1, +1, -1, +1, +1, +1, -1]),
}
stations = [station0, station1, station2]
medium = Medium(8, stations)
for i in range(8):
print(10*"-")
print("Step ", i+1)
print(10*"-")
medium.next_step();
print()