metrosim/test/simple_generate_agents_test.py

15 lines
441 B
Python

import os
import sys
from metrosim import RawPopulation
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, BASE_DIR)
# Load the raw population of the simple simulation example from its directory.
pop_file = os.path.join(BASE_DIR, 'metrosim/simple_simulation/population.json')
raw_pop = RawPopulation.from_file(pop_file)
# Generate the agents from the raw population.
agents = raw_pop.generate()