1
0
mirror of https://github.com/gsi-upm/soil synced 2025-06-30 18:52:21 +00:00
soil/soil/__init__.py
J. Fernando Sánchez e1be3a730e WIP soil
* Pandas integration
* Improved environment
* Logging and data dumps
* Tests
* Added Finite State Machine models
* Rewritten ipython notebook and documentation
2017-07-03 18:17:52 +02:00

43 lines
993 B
Python

import importlib
import sys
import os
__version__ = "0.9.2"
try:
basestring
except NameError:
basestring = str
from . import agents
from . import simulation
from . import environment
from . import utils
from . import settings
def main():
import argparse
from . import simulation
parser = argparse.ArgumentParser(description='Run a SOIL simulation')
parser.add_argument('file', type=str,
nargs="?",
default='simulation.yml',
help='python module containing the simulation configuration.')
parser.add_argument('--module', '-m', type=str,
help='file containing the code of any custom agents.')
args = parser.parse_args()
if args.module:
sys.path.append(os.getcwd())
importlib.import_module(args.module)
print('Loading config file: {}'.format(args.file))
simulation.run_from_config(args.file)
if __name__ == '__main__':
main()