-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #620 from flow-project/aimsun-load
Aimsun load template
- Loading branch information
Showing
4 changed files
with
78 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,9 @@ debug/ | |
.vs/** | ||
|
||
# Custom for Aimsun | ||
flow.ang | ||
*.ang.lck | ||
*flow.sqlite | ||
*.sqlite | ||
*.ang.old | ||
*.sang | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Load an already existing Aimsun template and run the simulation.""" | ||
|
||
from flow.core.experiment import Experiment | ||
from flow.core.params import AimsunParams, EnvParams, NetParams | ||
from flow.core.params import VehicleParams | ||
from flow.envs import TestEnv | ||
from flow.scenarios.loop import Scenario | ||
from flow.core.params import InFlows | ||
import flow.config as config | ||
import os | ||
|
||
sim_params = AimsunParams( | ||
sim_step=0.1, | ||
render=True, | ||
emission_path='data', | ||
replication_name="Replication 930", | ||
centroid_config_name="Centroid Configuration 910") | ||
|
||
env_params = EnvParams() | ||
vehicles = VehicleParams() | ||
|
||
template_path = os.path.join(config.PROJECT_PATH, | ||
"flow/utils/aimsun/small_template.ang") | ||
|
||
scenario = Scenario( | ||
name="aimsun_small_template", | ||
vehicles=vehicles, | ||
net_params=NetParams( | ||
inflows=InFlows(), | ||
template=template_path | ||
) | ||
) | ||
|
||
env = TestEnv(env_params, sim_params, scenario, simulator='aimsun') | ||
exp = Experiment(env) | ||
exp.run(1, 3000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.