private static string relationshipToString(SecureSimulator.RelationshipType rt) { if (rt == SecureSimulator.RelationshipType.CustomerOf) return "<-"; if (rt == SecureSimulator.RelationshipType.ProviderTo) return "->"; return "--"; }
private static void printDiamond(UInt32 pointASN,UInt32 stub, List<UInt32> competitors,SecureSimulator.NetworkGraph g, StreamWriter output) { SecureSimulator.AsNode pointASNode = g.GetNode(pointASN); SecureSimulator.AsNode stubASNode = g.GetNode(stub); foreach (UInt32 c in competitors) { SecureSimulator.AsNode cASNode = g.GetNode(c); output.WriteLine("{0} {1} {2} {3} {4}", pointASN, relationshipToString(cASNode.GetRelationshipTypeOfNeighbor(pointASNode)), c, relationshipToString(stubASNode.GetRelationshipTypeOfNeighbor(cASNode)), stub); } }