def AddBusinessLocationProfile(self, name, employees=20, customers=50, types=None): node = LayoutNodes.BusinessLocationProfile(name, employees, customers, types) WorldInfo.WorldInfo.AddBusinessLocationProfile(self, node) return node
def AddRoadType(self, name, lanes=1, pri=70, speed=2.0, wid=3.0, sig='1L', render=True, center=False): node = LayoutNodes.RoadType(name, lanes, pri, speed, wid, sig, render, center) WorldInfo.WorldInfo.AddRoadType(self, node) return node
def AddResidentialLocation(self, profname, endpoints): """ Args: profname -- string name of the business location profile collection endpoints -- list of endpoint objects of type LayoutNodes.Endpoint """ profile = self.Nodes[profname] if profile.NodeType.Name != LayoutNodes.ResidentialLocationProfile.__name__: raise ValueError( 'Invalid residential location profile name; {0}'.format( profname)) location = LayoutNodes.ResidentialLocation(GenName('rezloc'), profile) WorldInfo.WorldInfo.AddResidentialLocation(self, location) # residential locations have one endpoint per capsule for endpoint in endpoints: capsule = LayoutNodes.LocationCapsule(GenName('rezcap')) WorldInfo.WorldInfo.AddLocationCapsule(self, capsule) capsule.AddEndPointToCapsule(endpoint) location.AddCapsuleToLocation(capsule) return location
def AddIntersection(self, curx, cury, itype, prefix): name = GenNameFromCoordinates(curx, cury, prefix) node = LayoutNodes.Intersection(name, itype, curx, cury) WorldInfo.WorldInfo.AddIntersection(self, node) return node
def AddIntersectionType(self, name, itype='priority', render=True): node = LayoutNodes.IntersectionType(name, itype, render) WorldInfo.WorldInfo.AddIntersectionType(self, node) return node
def AddResidentialLocationProfile(self, name, residents=5): node = LayoutNodes.ResidentialLocationProfile(name, residents) WorldInfo.WorldInfo.AddResidentialLocationProfile(self, node) return node
def AddEndPoint(self, curx, cury, ntype, prefix): name = GenNameFromCoordinates(curx, cury, prefix) node = LayoutNodes.EndPoint(name, ntype, curx, cury) WorldInfo.WorldInfo.AddEndPoint(self, node) return node