grab 5 choices & sort them
This commit is contained in:
parent
e2b4d34e35
commit
4b695db457
@ -2150,8 +2150,32 @@ namespace EduNetworkBuilder
|
|||||||
//we will prompt for stuff. For now, just use the firewalls network
|
//we will prompt for stuff. For now, just use the firewalls network
|
||||||
LoadSolvedResource( SolvedNetworkNames.firewalls.ToString());
|
LoadSolvedResource( SolvedNetworkNames.firewalls.ToString());
|
||||||
myNetwork.NonVisualDoDHCPOnAll();
|
myNetwork.NonVisualDoDHCPOnAll();
|
||||||
TraversalClass tc = myNetwork.NonVisualPingOneHost("pc1", "pc2");
|
List<TraversalClass> TraversalCollection = new List<TraversalClass>();
|
||||||
tc.DumpPath();
|
|
||||||
|
//Choose five items to do
|
||||||
|
List<string> Devices = NB.Randomize<string>(myNetwork.GetHostnames());
|
||||||
|
int count = 0;
|
||||||
|
while (Devices.Count > 2 && count < 5)
|
||||||
|
{
|
||||||
|
TraversalClass tc = myNetwork.NonVisualPingOneHost(Devices[0], Devices[1]);
|
||||||
|
if(tc != null)
|
||||||
|
TraversalCollection.Add(tc);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("null generated by " + Devices[0] + " - " + Devices[1]);
|
||||||
|
}
|
||||||
|
Devices.RemoveAt(1);
|
||||||
|
Devices.RemoveAt(0);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
TraversalCollection.Sort((a, b) => b.Count.CompareTo(a.Count));
|
||||||
|
|
||||||
|
for(int i=0; i< TraversalCollection.Count; i++)
|
||||||
|
{
|
||||||
|
Console.WriteLine(i + " " + TraversalCollection[i].Source());
|
||||||
|
Console.WriteLine(i + " " + TraversalCollection[i].Destination());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion Random Map Stuff
|
#endregion Random Map Stuff
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ namespace EduNetworkBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<TraversalRecord> PathTaken = new List<TraversalRecord>();
|
List<TraversalRecord> PathTaken = new List<TraversalRecord>();
|
||||||
|
public int Count { get { return PathTaken.Count; } }
|
||||||
|
|
||||||
public TraversalClass(){ }
|
public TraversalClass(){ }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user