예제 #1
0
    def test_run_stepbystep_bottleneck_002(self):
        # Using new constructor
        sim_instance = Simulator.from_path(self.mocks_path, self.sim_path)

        with sim_instance as s:
            while s.do_next:
                s.run_step()
예제 #2
0
def test_create_vehicle_bottleneck_001(bottleneck_001, symuvia_library_path):
    symuflow = Simulator.from_path(bottleneck_001, symuvia_library_path)

    symuflow._set_manual_initialization()
    veh_id = symuflow.create_vehicle("VL", "Ext_In", "Ext_Out")

    assert veh_id == 0
예제 #3
0
def launch_simuflow(file) -> tuple:
    sim_instance = Simulator.from_path(file, DEFAULT_PATH_SYMUFLOW)
    sim_instance.trace_flow = True
    sim_instance.step_launch_mode = "full"

    with sim_instance as s:
        while s.do_next:
          s.run_step()
          yield sim_instance.simulationstep, sim_instance.request.datatraj
예제 #4
0
def test_runbystep_bottleneck_002(bottleneck_002, symuvia_library_path):
    sim_instance = Simulator.from_path(bottleneck_002, symuvia_library_path)
    with sim_instance as s:
        while s.do_next:
            s.run_step()
        assert s.do_next == False
예제 #5
0
def test_run_bottleneck_002(bottleneck_002, symuvia_library_path):
    sim_instance = Simulator.from_path(bottleneck_002, symuvia_library_path)
    sim_instance.run()
예제 #6
0
def test_constructor_bottleneck_002(bottleneck_002, symuvia_library_path):
    sim_instance = Simulator.from_path(bottleneck_002, symuvia_library_path)
    sim_instance.load_symuvia()
    valid = sim_instance.load_network()
    assert valid == 1
예제 #7
0
 def test_run_simulation_alternative_constructor_bottleneck_001(self):
     sim_instance = Simulator.from_path(self.mocks_path, self.sim_path)
     sim_instance.run_simulation()
예제 #8
0
 def test_constructor_bottleneck_001(self):
     sim_instance = Simulator.from_path(self.mocks_path, self.sim_path)
     self.assertEqual(self.mocks_path, sim_instance.casename)
예제 #9
0
def test_runbystep_bottleneck_001(bottleneck_001, symuvia_library_path):
    symuflow = Simulator.from_path(bottleneck_001, symuvia_library_path)
    with symuflow as s:
        while s.do_next:
            s.run_step()
        assert s.do_next == False
예제 #10
0
def test_run_bottleneck_001(bottleneck_001, symuvia_library_path):
    symuflow = Simulator.from_path(bottleneck_001, symuvia_library_path)
    symuflow.run()
예제 #11
0
def test_load_constructor_bottleneck_001(bottleneck_001, symuvia_library_path):
    symuflow = Simulator.from_path(bottleneck_001, symuvia_library_path)
    symuflow.load_symuvia()
    valid = symuflow.load_network()
    assert valid == 1