## Rated list simulation
This week, we defined the simulator for the rated list, as we now have the detailed specifications in place. The details can be found in the following steps.
### Simultation part
The process mainly consists of three key steps:
- Graph Construction: First, we construct the network graph, representing all nodes and their relationships within the system.
- Offline Node Simulation: Next, we simulate offline nodes by marking all descendant nodes of a particular level-1 node as offline. This helps us test how the system behaves when specific branches of the graph are affected by outages.
- Deeper Rated List Evaluation: Lastly, we extend the evaluation by going one more level into the rated list, which allows us to further assess how deeper layers of the graph respond to offline nodes and how the rating system handles these disruptions.
The main function can be found as follows:
```
def main():
acyclic_graph = construct_acyclic_graph(50)
# erdos_renyi = nx.erdos_renyi_graph(200, 0.3)
# path_graph = nx.path_graph(5)
sim_node = SimulatedNode(acyclic_graph, 0)
# sim_node = SimulatedNode(erdos_renyi)
# sim_node = SimulatedNode(path_graph)
sim_node.construct_tree()
offline_profile = NodeProfile(False, False, True)
# mark all descendants children of a particular level 1 node offline
defunct_sub_tree_root = list(sim_node.dht.nodes[sim_node.own_id].children)[0]
def random_selector(node_id):
# if node_id == defunct_sub_tree_root:
# return True
if node_id in sim_node.dht.nodes[defunct_sub_tree_root].children:
return True
# go one more level into the rated list
for child in sim_node.dht.nodes[defunct_sub_tree_root].children:
if node_id in sim_node.dht.nodes[child].children:
return True
return False
sim_node.bind(offline_profile, random_selector)
```
## Next week
- **Possibility check**: Can the system still operate when most nodes are offline? (Simulate random offline scenarios, such as 80% or 50% of nodes being offline, to test system performance under different conditions.)
- **Adversary simulation**: Start by simulating an individual adversarial node, which generates a malicious graph. Then, test the system's response with varying numbers of adversaries.
- **Turn on/off the rating system**: Verify whether the rating list remains effective in handling non-responsive or malicious adversaries.
- Generate a draft for the paper and select an appropriate conference for submission.