forked from cengwins/ahc_tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cengwins
committed
Jan 14, 2022
1 parent
feb7c3c
commit 6a68a12
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import os | ||
import sys | ||
import time | ||
|
||
from ahc.Routing.ARA.ExperimentLogger import ExperimentLogger | ||
|
||
sys.path.insert(0, os.getcwd()) | ||
|
||
import networkx as nx | ||
import matplotlib.pyplot as plt | ||
|
||
from ahc.Ahc import Thread, Topology | ||
from ahc.Ahc import ComponentRegistry | ||
from ahc.Channels.Channels import P2PFIFOPerfectChannel | ||
|
||
from ahc.Routing.ARA.ARATestComponent import ARATestComponent | ||
|
||
registry = ComponentRegistry() | ||
|
||
def main(): | ||
node_count = 30 | ||
G = nx.random_geometric_graph(node_count, 0.5) | ||
nx.draw(G, with_labels=True, font_weight='bold') | ||
|
||
topo = Topology() | ||
topo.construct_from_graph(G, ARATestComponent, P2PFIFOPerfectChannel) | ||
|
||
topo.start() | ||
# plt.show() | ||
|
||
while (True): pass | ||
|
||
if __name__ == "__main__": | ||
main() |