assert (os.path.exists(args.dir)) assert (os.path.exists(args.ssdir)) # Force enable streamit. os.environ["MARO_STREAMIT_ENABLED"] = "true" os.environ["MARO_STREAMIT_EXPERIMENT_NAME"] = args.name from maro.streamit import streamit with streamit: # experiment name with open(os.path.join(args.dir, "config.yml"), "r") as fp: config = yaml.safe_load(fp) # streamit.info(args.scenario, args.topology, args.durations, args.episodes) streamit.complex("config", config) for episode in range(args.episodes): epoch_folder = f"epoch_{episode}" epoch_full_path = os.path.join(args.ssdir, epoch_folder) # ensure epoch folder exist if os.path.exists(epoch_full_path): streamit.episode(episode) # import for each category port_number = import_port_details(streamit, epoch_full_path) vessel_number = import_vessel_details(streamit, epoch_full_path)
def _stream_base_info(self): if streamit: streamit.info(self._scenario_name, self._topology, self._max_tick) streamit.complex("config", self._config)