HI,
Previously, I had posted a question asking for some clarification regarding
the usage of types in Julia to suit the problem at hand. I had used
Python's classes for the problem and I would like to know how I can define
PhysicalNodes and PhysicalLinks classes in Julia differently than I did in
Python (as suggested By Jeffrey) So I request your help for the same.
Thanks a lot guys
The python code is as follows:
class PHY_NODES:
def __init__(self, nodeID, nodenum, x, y, demands):
self.id = nodeID
self.nodenum = nodenum
self.x = x
self.y = y
self.inEdges = []
self.outEdges = []
self.demands = demands
def __str__(self):
return "Physical Node ID: nodenum: %4d x: %.3f y: %.3f" %(self.id,
self.nodenum, self.x, self.y )
def addInEdge(self, edge):
self.inEdges.append( edge )
def addOutEdge(self, edge):
self.outEdges.append( edge )
class PHY_LINKS:
def __init__(self, linkID, source, destination, SourceID,
DestinationID,):
self.linkID = linkID
self.source = source
self.destination = destination
self.SourceID = SourceID
self.DestinationID = DestinationID
def __str__(self):
return "Physical Link ID: %4d source: %s destination: %s SourceID:
%4d DestinationID: %4d " %(self.linkID, self.source, self.destination,
self.SourceID, self.DestinationID, )
class DEMAND:
def __init__(self, PoP_bdw_up, PoP_stor, PoP_pro, MME_bdw_up, MME_stor,
MME_pro,demandID):
self.PoP_bdw_up = PoP_bdw_up
self.PoP_stor = PoP_stor
self.PoP_pro = PoP_pro
self.MME_bdw_up = MME_bdw_up
self.MME_stor = MME_stor
self.MME_pro = MME_pro
self.demandID = demandID
def __str__(self):
return " PoPbdwup: %.3f PoPstor: %.3f PoPpro: %.3f MMEbdwup: %.3f
MMEstor: %.3f MMEpro: %.3f, self.demandID )