Exemplo n.º 1
0
    def AddBusinessLocationProfile(self,
                                   name,
                                   employees=20,
                                   customers=50,
                                   types=None):
        node = LayoutNodes.BusinessLocationProfile(name, employees, customers,
                                                   types)
        WorldInfo.WorldInfo.AddBusinessLocationProfile(self, node)

        return node
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    def AddIntersectionType(self, name, itype='priority', render=True):
        node = LayoutNodes.IntersectionType(name, itype, render)
        WorldInfo.WorldInfo.AddIntersectionType(self, node)

        return node
Exemplo n.º 6
0
    def AddResidentialLocationProfile(self, name, residents=5):
        node = LayoutNodes.ResidentialLocationProfile(name, residents)
        WorldInfo.WorldInfo.AddResidentialLocationProfile(self, node)

        return node
Exemplo n.º 7
0
    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