2020-10-22 11:02:41 -04:00
|
|
|
"""
|
|
|
|
PhysicsFactory retrieve the specific physics module for the given region
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
|
|
|
|
|
|
|
from pathlib import Path
|
2020-10-28 13:14:05 -04:00
|
|
|
from factories.occupancy.occupancy_feeders.demo_occupancy_parameters import DemoOccupancyParameters
|
2020-10-22 11:02:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
class OccupancyFactory:
|
|
|
|
"""
|
|
|
|
PhysicsFactor class
|
|
|
|
"""
|
|
|
|
def __init__(self, handler, city, base_path=Path(Path(__file__).parent.parent / 'data/occupancy')):
|
|
|
|
self._handler = '_' + handler.lower().replace(' ', '_')
|
|
|
|
self._city = city
|
|
|
|
self._base_path = base_path
|
|
|
|
self.factory()
|
|
|
|
|
|
|
|
def _demo(self):
|
|
|
|
DemoOccupancyParameters(self._city, self._base_path)
|
|
|
|
|
|
|
|
def factory(self):
|
|
|
|
"""
|
|
|
|
Enrich the city with the physics information
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
getattr(self, self._handler, lambda: None)()
|