Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions adf_core_python/main.py
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
import argparse

from adf_core_python.core.config.config import Config
from adf_core_python.core.launcher.agent_launcher import AgentLauncher
from adf_core_python.core.launcher.config_key import ConfigKey


class Main:
def __init__(self) -> None:
Expand DownExpand Up@@ -55,7 +59,23 @@ def __init__(self) -> None:
)
args = parser.parse_args()
print(args)
self.config = Config()
self.config.set_value(ConfigKey.KEY_KERNEL_HOST, args.host)
self.config.set_value(ConfigKey.KEY_KERNEL_PORT, args.port)
self.config.set_value(ConfigKey.KEY_AMBULANCE_CENTRE_COUNT, args.ambulance)
self.config.set_value(ConfigKey.KEY_FIRE_STATION_COUNT, args.firebrigade)
self.config.set_value(ConfigKey.KEY_POLICE_OFFICE_COUNT, args.policeforce)
self.config.set_value(ConfigKey.KEY_PRECOMPUTE, args.precompute)
self.config.set_value(ConfigKey.KEY_DEBUG_FLAG, args.verbose)

def launch(self) -> None:
agent_launcher: AgentLauncher = AgentLauncher(
self.config,
)
agent_launcher.init_connector()
agent_launcher.launch()


if __name__ == "__main__":
main = Main()
main.launch()