Example #1
0
    def test_readCubeDemand(self):

        fileName = os.path.join(os.path.dirname(__file__), '..', 'testdata',
                                'dynameqNetwork_gearySubset',
                                'cubeTestDemand.txt')

        net = getTestNet()

        demand = Demand.readCubeODTable(fileName, net, "AUTO", Time(7, 0),
                                        Time(8, 0))

        assert demand.getValue(Time(8, 0), 2, 6) == 1000
        assert demand.getValue(Time(8, 0), 6, 2) == 4000
Example #2
0
    def NOtest_applyTimeOfDayFactors(self):

        fileName = os.path.join(os.path.dirname(__file__), '..', 'testdata',
                                'dynameqNetwork_gearySubset',
                                'cubeTestDemand.txt')

        net = getTestNet()
        demand = Demand.readCubeODTable(fileName, net, "AUTO", Time(7, 0),
                                        Time(8, 0))

        d2 = demand.applyTimeOfDayFactors([0.5, 0.5])

        assert d2.getValue(730, 2, 6) == 500
        assert d2.getValue(800, 2, 6) == 500