From 3b592316fd8bd6c443783954395f20774108ec01 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Wed, 23 Sep 2020 02:03:50 +0800 Subject: [PATCH 01/25] initalize gnn netowrk for ECR problem --- examples/ecr/gnn/action_shaper.py | 38 +++ examples/ecr/gnn/actor.py | 376 ++++++++++++++++++++++++++ examples/ecr/gnn/actor_critic.py | 189 +++++++++++++ examples/ecr/gnn/agent.py | 40 +++ examples/ecr/gnn/agent_manager.py | 86 ++++++ examples/ecr/gnn/config.yml | 38 +++ examples/ecr/gnn/differ_gnn_model.py | 131 +++++++++ examples/ecr/gnn/experience_shaper.py | 102 +++++++ examples/ecr/gnn/launcher.py | 77 ++++++ examples/ecr/gnn/learner.py | 52 ++++ examples/ecr/gnn/numpy_store.py | 187 +++++++++++++ examples/ecr/gnn/shared_structure.py | 38 +++ examples/ecr/gnn/simple_gnn.py | 329 ++++++++++++++++++++++ examples/ecr/gnn/state_shaper.py | 237 ++++++++++++++++ examples/ecr/gnn/transformer.py | 342 +++++++++++++++++++++++ examples/ecr/gnn/utils.py | 358 ++++++++++++++++++++++++ 16 files changed, 2620 insertions(+) create mode 100644 examples/ecr/gnn/action_shaper.py create mode 100644 examples/ecr/gnn/actor.py create mode 100644 examples/ecr/gnn/actor_critic.py create mode 100644 examples/ecr/gnn/agent.py create mode 100644 examples/ecr/gnn/agent_manager.py create mode 100644 examples/ecr/gnn/config.yml create mode 100644 examples/ecr/gnn/differ_gnn_model.py create mode 100644 examples/ecr/gnn/experience_shaper.py create mode 100644 examples/ecr/gnn/launcher.py create mode 100644 examples/ecr/gnn/learner.py create mode 100644 examples/ecr/gnn/numpy_store.py create mode 100644 examples/ecr/gnn/shared_structure.py create mode 100644 examples/ecr/gnn/simple_gnn.py create mode 100644 examples/ecr/gnn/state_shaper.py create mode 100644 examples/ecr/gnn/transformer.py create mode 100644 examples/ecr/gnn/utils.py diff --git a/examples/ecr/gnn/action_shaper.py b/examples/ecr/gnn/action_shaper.py new file mode 100644 index 000000000..b568a3fa8 --- /dev/null +++ b/examples/ecr/gnn/action_shaper.py @@ -0,0 +1,38 @@ +import math +from maro.rl import ActionShaper + +class DiscreteActionShaper(ActionShaper): + def __init__(self, action_dim): + self._action_dim = action_dim + self._zero_action = self._action_dim // 2 + + def __call__(self, pending_action, model_action): + ''' + This function maps integer model action within the range of [-A, A] to actual action. We define negative actual + action as discharge resource from vessel to port and positive action as upload from port to vessel, so the + upper bound and lower bound of actual action are the resource in dynamic and static node respectively. + + Args: + pending_action (Event) + model_action (int): output action, range A means the half of the agent output dim + ''' + tick = pending_action.tick + env_action = 0 + action_index = model_action + model_action -= self._zero_action + + action_scope = pending_action.action_scope + + if model_action < 0: + # discharge resource from dynamic node + env_action = round(int(model_action) * 1.0/self._zero_action * action_scope.load) + elif model_action == 0: + env_action =0 + else: + # load resource to dynamic node + env_action = round(int(model_action) * 1.0/self._zero_action * action_scope.discharge) + env_action = int(env_action) + + return env_action + + diff --git a/examples/ecr/gnn/actor.py b/examples/ecr/gnn/actor.py new file mode 100644 index 000000000..da17bf159 --- /dev/null +++ b/examples/ecr/gnn/actor.py @@ -0,0 +1,376 @@ +import time, os, pickle, math +import multiprocessing +import numpy as np +import torch.nn.functional as F +from torch.distributions import Categorical +import ctypes +import torch +from multiprocessing import Process, Pipe, Event, Manager + +from maro.simulator import Env +from maro.rl import AbsActor +from examples.ecr.gnn.numpy_store import NumpyStore, Shuffler +from examples.ecr.gnn.action_shaper import DiscreteActionShaper +from examples.ecr.gnn.utils import fix_seed, differ_gnn_union +from examples.ecr.gnn.experience_shaper import ExperienceShaper +from examples.ecr.gnn.differ_gnn_model import SharedAC +from examples.ecr.gnn.state_shaper import GNNStateShaper +from collections import defaultdict, OrderedDict +from examples.ecr.gnn.actor_critic import ActorCritic +from maro.simulator import Env +from maro.simulator.scenarios.ecr.common import Action, DecisionEvent +from maro.utils import Logger, LogFormat, convert_dottable +from examples.ecr.gnn.shared_structure import SharedStructure +from examples.ecr.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix +import random + + +def organize_exp_list(experience_collections:dict, idx_mapping:dict): + ''' + The function assemble the experience from multiple processes into a dictionary. + + Args: + experience_collections (dict): It stores the experience in all agents. The structure is the same as what is + defined in the SharedStructure in the ParallelActor except additional key for experience length. For + example: + + { + 'len': numpy.array, + 's': { + 'v': numpy.array, + 'p': numpy.array, + } + 'a': numpy.array, + 'R': numpy.array, + 's_': { + 'v': numpy.array, + 'p': numpy.array, + } + } + + Note that the experience from different agents are stored in the same batch in a sequential way. For + example, if agent x starts at b_x in batch index and the experience is l_x length long, the range [b_x, + l_x) in the batch is the experience of agent x. + + idx_mapping (dict): The key is the name of each agent and the value is the starting index, e.g., b_x, of the + storage space where the experience of the agent is stored. + ''' + result = {} + tmpi = 0 + for code, idx in idx_mapping.items(): + exp_len = experience_collections['len'][0][tmpi] + + s = organize_obs(experience_collections['s'], idx, exp_len) + s_ = organize_obs(experience_collections['s_'], idx, exp_len) + R = experience_collections['R'][idx:idx+exp_len] + R = R.reshape(-1, *R.shape[2:]) + a = experience_collections['a'][idx:idx+exp_len] + a = a.reshape(-1, *a.shape[2:]) + + result[code] = { + 'R': R, + 'a': a, + 's': s, + 's_': s_, + 'len': a.shape[0] + } + tmpi += 1 + return result + +def organize_obs(obs, idx, exp_len): + '''Helper function to transform the observation from multiple processes to a unified dictionary. + ''' + tick_buffer, _, para_cnt, v_cnt, v_dim = obs['v'].shape + _, _, _, p_cnt, p_dim = obs['p'].shape + batch = exp_len * para_cnt + # v: tick_buffer, seq_len, parallel_cnt, v_cnt, v_dim --> (tick_buffer, cnt, v_cnt, v_dim) + v = obs['v'][:, idx: idx+exp_len] + v = v.reshape(tick_buffer, batch, v_cnt, v_dim) + p = obs['p'][:, idx: idx+exp_len] + p = p.reshape(tick_buffer, batch, p_cnt, p_dim) + # vo: seq_len * parallel_cnt * v_cnt * p_cnt* --> cnt * v_cnt * p_cnt* + vo = obs['vo'][idx: idx+exp_len] + vo = vo.reshape(batch, v_cnt, vo.shape[-1]) + po = obs['po'][idx: idx+exp_len] + po = po.reshape(batch, p_cnt, po.shape[-1]) + vedge = obs['vedge'][idx: idx+exp_len] + vedge = vedge.reshape(batch, v_cnt, vedge.shape[-2], vedge.shape[-1]) + pedge = obs['pedge'][idx: idx+exp_len] + pedge = pedge.reshape(batch, p_cnt, pedge.shape[-2], pedge.shape[-1]) + ppedge = obs['ppedge'][idx: idx+exp_len] + ppedge = ppedge.reshape(batch, p_cnt, ppedge.shape[-2], ppedge.shape[-1]) + + # mask: (seq_len, parallel_cnt, tick_buffer) + mask = obs['mask'][idx: idx+exp_len].reshape(batch, tick_buffer) + + return {'v': v, 'p': p, 'vo': vo, 'po': po, 'pedge': pedge, 'vedge': vedge, 'ppedge': ppedge, 'mask': mask} + + + +def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_output): + '''The A2C worker function to collect experience. + + Args: + index (int): The process index counted from 0. + config (dict): It is a dottable dictionary that stores the configuration of the simulation, state_shaper and + postprocessing shaper. + exp_idx_mapping (dict): The key is agent code and the value is the starting index where the experience is stored + in the experience batch. + pipe (Pipe): The pipe instance for communication with the main process. + action_io (SharedStructure): The shared memory to hold the state information that the main process uses to + generate an action. + exp_output (SharedStructure): The shared memory to transfer the experience list to the main process. + ''' + env = Env(**config.env.param) + fix_seed(env, config.env.seed) + static_code_list, dynamic_code_list = list(env.summary['node_mapping']['ports'].values()), \ + list(env.summary['node_mapping']['vessels'].values()) + # create gnn_state_shaper without consuming any resources + + gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, + config.model.feature, tick_buffer=config.model.tick_buffer, + max_value=env.configs['total_containers']) + gnn_state_shaper.compute_static_graph_structure(env) + + action_io_np = action_io.structuralize() + + action_shaper = DiscreteActionShaper(config.model.action_dim) + exp_shaper = ExperienceShaper(static_code_list, dynamic_code_list, config.env.param.durations, gnn_state_shaper, + scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, + discount_factor=config.training.gamma, idx=index, + shared_storage=exp_output.structuralize(), exp_idx_mapping=exp_idx_mapping) + + i = 0 + while pipe.recv() == 'reset': + env.reset() + r, pa, is_done = env.step(None) + j = 0 + + logs = [] + while not is_done: + model_input = gnn_state_shaper(pa, env.snapshot_list) + action_io_np['v'][:, index] = model_input['v'] + action_io_np['p'][:, index] = model_input['p'] + action_io_np['vo'][index] = model_input['vo'] + action_io_np['po'][index] = model_input['po'] + action_io_np['vedge'][index] = model_input['vedge'] + action_io_np['pedge'][index] = model_input['pedge'] + action_io_np['ppedge'][index] = model_input['ppedge'] + action_io_np['mask'][index] = model_input['mask'] + action_io_np['pid'][index] = pa.port_idx + action_io_np['vid'][index] = pa.vessel_idx + pipe.send('features') + model_action = pipe.recv() + env_action = action_shaper(pa, model_action) + exp_shaper.record(pending_action=pa, model_action=model_action, model_input=model_input) + logs.append([index, pa.tick, pa.port_idx, pa.vessel_idx, model_action, env_action, pa.action_scope.load, + pa.action_scope.discharge]) + action = Action(pa.vessel_idx, pa.port_idx, env_action) + r, pa, is_done = env.step(action) + j += 1 + action_io_np['sh'][index] = compute_shortage(env.snapshot_list, config.env.param.durations, static_code_list) + # print('one ep done!') + i += 1 + pipe.send('done') + gnn_state_shaper.end_ep_callback(env.snapshot_list) + # organize and synchronize exp to shared memory + exp_shaper(env.snapshot_list) + exp_shaper.reset() + logs = np.array(logs, dtype=np.float) + pipe.send(logs) + + print('the end') + +def compute_shortage(snapshot_list, max_tick, static_code_list): + '''Helper function to compute the shortage after a episode end. + ''' + return np.sum(snapshot_list["ports"][max_tick-1: static_code_list: "acc_shortage"]) + +class ParallelActor(AbsActor): + def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): + '''A2C rollout class + + This implements the synchronized A2C structure. Multiple processes are created to simulate and collect + experience where only CPU is needed and whenever an action is required, they notify the main process and the + main process will do the batch action inference with GPU. + + Args: + config (dict): The configuration to run the simulation. + demo_env (maro.simulator.Env): To get configuration information such as the amount of vessels and ports as + well as the topology of the environment, the example environment is needed. + gnn_state_shaper (AbsShaper): The state shaper instance to extract graph information from the state of + the environment. + agent_manager (AbsAgentManger): The agent manager instance to do the action inference in batch. + logger: The logger instance to log information during the rollout. + + ''' + multiprocessing.set_start_method('spawn', True) + self._logger = logger + self.config = config + + self._static_node_mapping = demo_env.summary['node_mapping']['ports'] + self._dynamic_node_mapping = demo_env.summary['node_mapping']['vessels'] + self._gnn_state_shaper = gnn_state_shaper + self._agent_manager = agent_manager + self.device = torch.device(config.training.device) + + self.parallel_cnt = config.training.parallel_cnt + self.log_header = ['sh_%d'%i for i in range(self.parallel_cnt)] + + tick_buffer = config.model.tick_buffer + action_dim = config.model.action_dim + + v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim('v'), self._gnn_state_shaper.get_input_dim('vedge'), len(self._dynamic_node_mapping) + p_dim, pedge_dim, p_cnt = self._gnn_state_shaper.get_input_dim('p'), self._gnn_state_shaper.get_input_dim('pedge'), len(self._static_node_mapping) + + self.pipes = [Pipe() for i in range(self.parallel_cnt)] + + action_io_structure = { + 'p': ((tick_buffer, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), + 'v': ((tick_buffer, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), + 'po': ((self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), + 'vo': ((self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), + 'vedge': ((self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), + 'pedge': ((self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), + 'ppedge': ((self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), + 'mask': ((self.parallel_cnt, tick_buffer), ctypes.c_bool), + 'sh': ((self.parallel_cnt, ), ctypes.c_long), + 'pid': ((self.parallel_cnt, ), ctypes.c_long), + 'vid': ((self.parallel_cnt, ), ctypes.c_long) + } + self.action_io = SharedStructure(action_io_structure) + self.action_io_np = self.action_io.structuralize() + + tot_exp_len = sum(config.env.exp_per_ep.values()) + + exp_output_structure = { + 's': { + 'v': ((tick_buffer, tot_exp_len, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), + 'p': ((tick_buffer, tot_exp_len, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), + 'vo': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), + 'po': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), + 'vedge': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), + 'pedge': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), + 'ppedge': ((tot_exp_len, self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), + 'mask': ((tot_exp_len, self.parallel_cnt, tick_buffer), ctypes.c_bool) + }, + 's_': { + 'v': ((tick_buffer, tot_exp_len, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), + 'p': ((tick_buffer, tot_exp_len, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), + 'vo': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), + 'po': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), + 'vedge': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), + 'pedge': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), + 'ppedge': ((tot_exp_len, self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), + 'mask': ((tot_exp_len, self.parallel_cnt, tick_buffer), ctypes.c_bool) + }, + 'a': ((tot_exp_len, self.parallel_cnt), ctypes.c_long), + 'len': ((self.parallel_cnt, len(config.env.exp_per_ep)), ctypes.c_long), + 'R': ((tot_exp_len, self.parallel_cnt, p_cnt), ctypes.c_float), + } + self.exp_output = SharedStructure(exp_output_structure) + self.exp_output_np = self.exp_output.structuralize() + + self._logger.info('allocate complete') + + self.exp_idx_mapping = OrderedDict() + acc_c = 0 + for key, c in config.env.exp_per_ep.items(): + self.exp_idx_mapping[key] = acc_c + acc_c += c + + self.workers = [Process( + target=single_player_worker, args=(i, config, self.exp_idx_mapping, self.pipes[i][1], + self.action_io, self.exp_output)) + for i in range(self.parallel_cnt)] + for w in self.workers: + w.start() + + self._logger.info('all thread started') + + self._roll_out_time = 0 + self._trainsfer_time = 0 + self._roll_out_cnt = 0 + + def roll_out(self): + '''Rollout using current policy in the AgentManager. + + Returns: + result (dict): The key is the agent code, the value is the experience list stored in numpy.array. + ''' + + # compute the time used for state preparation in the child process. + t_state = 0 + # compute the time used for action inference. + t_action = 0 + + for p in self.pipes: + p[0].send('reset') + self._roll_out_cnt += 1 + + step_i = 0 + tick = time.time() + while True: + signals = [p[0].recv() for p in self.pipes] + if signals[0] == 'done': + break + + # print('step: %d'%step_i) + step_i += 1 + + t = time.time() + graph = differ_gnn_union(self.action_io_np['p'], self.action_io_np['po'], self.action_io_np['pedge'], + self.action_io_np['v'], self.action_io_np['vo'], self.action_io_np['vedge'], + self._gnn_state_shaper.p2p_static_graph, self.action_io_np['ppedge'], self.action_io_np['mask'], self.device) + t_state += time.time() - t + + # print(self.action_io_np['pid']) + assert(np.min(self.action_io_np['pid']) == np.max(self.action_io_np['pid'])) + assert(np.min(self.action_io_np['vid']) == np.max(self.action_io_np['vid'])) + + t = time.time() + actions = self._agent_manager.choose_action(agent_id = (self.action_io_np['pid'][0], self.action_io_np['vid'][0]), state=graph) + t_action += time.time() - t + + for i, p in enumerate(self.pipes): + p[0].send(actions[i]) + + self._roll_out_time += time.time() - tick + # print(self.exp_output_np['len']) + tick = time.time() + self._logger.info('receiving exp') + logs = [p[0].recv() for p in self.pipes] + + self._logger.info("Mean of shortage: %f" % np.mean(self.action_io_np['sh'])) + self._trainsfer_time += time.time() - tick + + + self.logger.debug(dict(zip(self.log_header, self.action_io_np['sh']))) + # print(loged_dict) + + with open(os.path.join(self.config.log.path, 'logs_%d'%self._roll_out_cnt), 'wb') as fp: + pickle.dump(logs, fp) + + + self._logger.info('organize exp_dict') + result = organize_exp_list(self.exp_output_np, self.exp_idx_mapping) + + if self.config.log.exp.enable and self._roll_out_cnt % self.config.log.exp.freq == 0: + with open(os.path.join(self.config.log.path, 'exp_%d'%self._roll_out_cnt), 'wb') as fp: + pickle.dump(result, fp) + + self._logger.debug('play time: %d' % int(self._actor._roll_out_time)) + self._logger.debug('transfer time: %d' % int(self._actor._trainsfer_time)) + return result + + def exit(self): + '''Terminate the child processes. + ''' + for p in self.pipes: + p[0].send('close') + + def save_model(self, pth, id): + self._algorithm.save_model(pth, id) + + def load_model(self, pth): + self._algorithm.load_model(pth) diff --git a/examples/ecr/gnn/actor_critic.py b/examples/ecr/gnn/actor_critic.py new file mode 100644 index 000000000..4d138cb4b --- /dev/null +++ b/examples/ecr/gnn/actor_critic.py @@ -0,0 +1,189 @@ +import numpy as np + +import torch, os +from torch.distributions import Categorical +from torch import nn +import torch.nn.functional as F +from torch.nn.utils import clip_grad + +from maro.rl import AbsAlgorithm + +from examples.ecr.gnn.utils import differ_gnn_union + +class ActorCritic(AbsAlgorithm): + def __init__(self, model: nn.Module, + device: torch.device, + p2p_adj=None, + td_steps=100, + gamma=0.97, + learning_rate=0.0003, + entropy_factor=0.1): + ''' + + Actor-Critic algorithm in ECR problem. + + Args: + model (nn.Module): A actor-critic module outputing both the policy network and the value network + device (torch.device): A PyTorch device instance where the module is computed on. + p2p_adj (numpy.array): The static port-to-port adjencency matrix. + td_steps (int): The value 'n' in the n-step TD algorithm. + gamma (float): The time decay. + learning_rate (float): The learning rate for the module. + entropy_factor (float): The weight of the policy's entropy to boost exploration. + ''' + self._model = model + + self._gamma = gamma + self._td_steps = td_steps + self._value_discount = gamma**100 + self._optimizer = torch.optim.Adam(self._model.parameters(), lr=learning_rate) + self._entropy_factor = entropy_factor + self._device = device + self._tot_batchs = 0 + self._p2p_adj = p2p_adj + + def choose_action(self, state: dict, p_idx: int, v_idx: int): + ''' + Args: + state (dict): A dictionary containing the input to the module. For example: + { + 'v': v, + 'p': p, + 'pe': { + 'edge': pedge, + 'adj': padj, + 'mask': pmask, + }, + 've': { + 'edge': vedge, + 'adj': vadj, + 'mask': vmask, + }, + 'ppe': { + 'edge': ppedge, + 'adj': p2p_adj, + 'mask': p2p_mask, + }, + 'mask': seq_mask, + } + p_idx (int): The identity of the port doing the action. + v_idx (int): The identity of the vessel doing the action. + + Returns: + model_action (numpy.int64): The action returned from the module + ''' + with torch.no_grad(): + prob, _ = self._model(state, a=True, p_idx=p_idx, v_idx=v_idx) + distribution = Categorical(prob) + model_action = distribution.sample().cpu().numpy() + return model_action + + def train(self, batch, p_idx, v_idx): + ''' + Args: + batch (dict): The dictionary of a batch of experience. For example: + { + 's': the dictionary of state, + 'a': model actions in numpy array, + 'R': the n-step accumulated reward, + 's'': the dictionary of the next state, + } + p_idx (int): The identity of the port doing the action. + v_idx (int): The identity of the vessel doing the action. + + Returns: + a_loss (float): action loss. + c_loss (float): critic loss. + e_loss (float): entropy loss. + tot_norm (float): the L2 norm of the gradient. + + ''' + self._tot_batchs += 1 + item_a_loss, item_c_loss, item_e_loss = 0, 0, 0 + obs_batch = batch['s'] + action_batch = batch['a'] + return_batch = batch['R'] + next_obs_batch = batch['s_'] + + obs_batch = differ_gnn_union(obs_batch['p'], obs_batch['po'], obs_batch['pedge'], obs_batch['v'], + obs_batch['vo'], obs_batch['vedge'], self._p2p_adj, obs_batch['ppedge'], + obs_batch['mask'], self._device) + action_batch = torch.from_numpy(action_batch).long().to(self._device) + return_batch = torch.from_numpy(return_batch).float().to(self._device) + next_obs_batch = differ_gnn_union(next_obs_batch['p'], next_obs_batch['po'], next_obs_batch['pedge'], + next_obs_batch['v'], next_obs_batch['vo'], next_obs_batch['vedge'], + self._p2p_adj, next_obs_batch['ppedge'], next_obs_batch['mask'], + self._device) + + # train actor network + # self._actor_optimizer.zero_grad() + # self._critic_optimizer.zero_grad() + self._optimizer.zero_grad() + + # every port has a value + # values.shape: (batch, p_cnt) + + probs, values = self._model(obs_batch, a=True, p_idx=p_idx, v_idx=v_idx, c=True) + distribution = Categorical(probs) + log_prob = distribution.log_prob(action_batch) + entropy_loss = distribution.entropy() + + _, values_ = self._model(next_obs_batch, c=True) + advantage = return_batch + self._value_discount * values_.detach() - values + + if self._entropy_factor != 0: + # actor_loss = actor_loss* torch.log(entropy_loss + np.e) + advantage[:, p_idx] += self._entropy_factor*entropy_loss.detach() + + actor_loss = - (log_prob*torch.sum(advantage, axis=-1).detach()).mean() + + # actor_loss.backward(retain_graph=True) + # self._actor_optimizer.step() + + item_a_loss = actor_loss.item() + item_e_loss = entropy_loss.mean().item() + + # train critic network + critic_loss = torch.sum(advantage.pow(2), axis=1).mean() + # critic_loss.backward() + item_c_loss = critic_loss.item() + # torch.nn.utils.clip_grad_norm_(self._critic_model.parameters(),0.5) + # self._critic_optimizer.step() + tot_loss = 0.1*actor_loss + critic_loss # - self._entropy_factor * entropy_loss + tot_loss.backward() + tot_norm = clip_grad.clip_grad_norm_(self._model.parameters(), 1) + self._optimizer.step() + return item_a_loss, item_c_loss, item_e_loss, float(tot_norm) + + def set_weights(self, weights): + self._model.load_state_dict(weights) + + def get_weights(self): + return self._model.state_dict() + + def _get_save_idx(self, fp_str): + return int(fp_str.split('.')[0].split('_')[0]) + + def save_model(self, pth, id): + if not os.path.exists(pth): + os.makedirs(pth) + pth = os.path.join(pth, '%d_ac.pkl'%id) + torch.save(self._model.state_dict(), pth) + + def _set_gnn_weights(self, weights): + for key in weights: + if key in self._model.state_dict().keys(): + self._model.state_dict()[key].copy_(weights[key]) + + def load_model(self, folder_pth, idx=-1): + if idx == -1: + fps = os.listdir(folder_pth) + fps = [f for f in fps if 'ac' in f] + fps.sort(key=self._get_save_idx) + ac_pth = fps[-1] + else: + ac_pth = '%d_ac.pkl'%idx + pth = os.path.join(folder_pth, ac_pth) + with open(pth, 'rb') as fp: + weights = torch.load(fp, map_location=self._device) + self._set_gnn_weights(weights) \ No newline at end of file diff --git a/examples/ecr/gnn/agent.py b/examples/ecr/gnn/agent.py new file mode 100644 index 000000000..27dd5b376 --- /dev/null +++ b/examples/ecr/gnn/agent.py @@ -0,0 +1,40 @@ +from maro.rl import AbsAgent +from maro.utils import DummyLogger +import time +from collections import defaultdict +from examples.ecr.gnn.numpy_store import Shuffler +import numpy as np + +class TrainableAgent(AbsAgent): + def __init__(self, name, algorithm, experience_pool, logger=DummyLogger()): + self._logger = logger + super().__init__(name, algorithm, experience_pool) + + def train(self, training_config): + loss_dict = defaultdict(list) + loss_rt = defaultdict(float) + # for code, exp_pool in experience_pool_dict.items(): + for j in range(training_config.shuffle_time): + shuffler = Shuffler(self._experience_pool, batch_size=training_config.batch_size) + while shuffler.has_next(): + batch = shuffler.next() + actor_loss, critic_loss, entropy_loss, tot_loss = self._algorithm.train(batch, self._name[0], + self._name[1], entropy= training_config.entropy_loss_enable) + loss_dict['actor'].append(actor_loss) + loss_dict['critic'].append(critic_loss) + loss_dict['entropy'].append(entropy_loss) + loss_dict['tot'].append(tot_loss) + + a_loss = np.mean(loss_dict['actor']) + c_loss = np.mean(loss_dict['critic']) + e_loss = np.mean(loss_dict['entropy']) + tot_loss = np.mean(loss_dict['tot']) + self._logger.debug('code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f'%(str(self._name), a_loss, + c_loss, e_loss, tot_loss)) + + self._experience_pool.clear() + return loss_dict + + def choose_action(self, model_state): + return self._algorithm.choose_action(model_state, self._name[0], self._name[1]) + \ No newline at end of file diff --git a/examples/ecr/gnn/agent_manager.py b/examples/ecr/gnn/agent_manager.py new file mode 100644 index 000000000..8927d1532 --- /dev/null +++ b/examples/ecr/gnn/agent_manager.py @@ -0,0 +1,86 @@ +from maro.rl import AbsAgentManager, AgentMode +from examples.ecr.gnn.agent import TrainableAgent +from examples.ecr.gnn.actor_critic import ActorCritic +# from examples.ecr.gnn.differ_gnn_model import SharedAC +from examples.ecr.gnn.simple_gnn import SharedAC +from examples.ecr.gnn.numpy_store import NumpyStore +from examples.ecr.gnn.utils import compute_v2p_degree_matrix +from maro.utils import DummyLogger +import numpy as np +from copy import copy +import torch + +class SimpleAgentManger(AbsAgentManager): + def __init__(self, name, + agent_id_list, + port_code_list, + vessel_code_list, + demo_env, + state_shaper, + logger=DummyLogger()): + super().__init__(name, + AgentMode.TRAIN, + agent_id_list, + state_shaper=state_shaper, + action_shaper=None, + experience_shaper=None, + explorer=None) + self.port_code_list = copy(port_code_list) + self.vessel_code_list = copy(vessel_code_list) + self.demo_env = demo_env + self._logger = logger + + def assemble(self, config): + v_dim, vedge_dim, v_cnt = self._state_shaper.get_input_dim('v'), self._state_shaper.get_input_dim('vedge'), len(self.vessel_code_list) + p_dim, pedge_dim, p_cnt = self._state_shaper.get_input_dim('p'), self._state_shaper.get_input_dim('pedge'), len(self.port_code_list) + + self.device = torch.device(config.training.device) + self._logger.info(config.training.device) + ac_model = SharedAC(p_dim, pedge_dim, v_dim, vedge_dim, config.model.tick_buffer, config.model.action_dim).to(self.device) + + value_dict = { + ('s', 'v'): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim('v')), np.float32, False), + ('s', 'p'): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim('p')), np.float32, False), + ('s', 'vo'): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), + ('s', 'po'): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), + ('s', 'vedge'): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), + ('s', 'pedge'): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), + ('s', 'ppedge'): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('pedge')), np.float32, True), + ('s', 'mask'): ((config.model.tick_buffer, ), np.bool, True), + + ('s_', 'v'): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim('v')), np.float32, False), + ('s_', 'p'): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim('p')), np.float32, False), + ('s_', 'vo'): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), + ('s_', 'po'): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), + ('s_', 'vedge'): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), + ('s_', 'pedge'): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), + ('s_', 'ppedge'): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('pedge')), np.float32, True), + ('s_', 'mask'): ((config.model.tick_buffer, ), np.bool, True), + + # to identify one dimension variable + ('R',): ((len(self.port_code_list), ), np.float32, True), + ('a',): (tuple(), np.int64, True), + } + + self._algorithm = ActorCritic(ac_model, self.device, td_steps=config.training.td_steps, + p2p_adj=self._state_shaper.p2p_static_graph, gamma=config.training.gamma, + learning_rate=config.training.learning_rate) + + for agent_id, cnt in config.env.exp_per_ep.items(): + experience_pool = NumpyStore(value_dict, config.training.parallel_cnt*config.training.train_freq * cnt) + self._agent_dict[agent_id] = TrainableAgent(agent_id, self._algorithm, experience_pool, self._logger) + + def choose_action(self, agent_id, state): + return self._agent_dict[agent_id].choose_action(state) + + def load_models_from_files(self, model_pth): + self._algorithm.load_model(model_pth) + + def train(self, training_config): + + for agent in self._agent_dict.values(): + agent.train(training_config) + + def store_experiences(self, experiences): + for code, exp_list in experiences.items(): + self._agent_dict[code].store_experiences(exp_list) \ No newline at end of file diff --git a/examples/ecr/gnn/config.yml b/examples/ecr/gnn/config.yml new file mode 100644 index 000000000..354eeea7e --- /dev/null +++ b/examples/ecr/gnn/config.yml @@ -0,0 +1,38 @@ +env: + seed: 10 + param: + durations: 750 + scenario: "ecr" + topology: 'global_trade.22p_l0.0' + # topology: "toy.4p_ssdd_l0.0" +training: + enable: True + parallel_cnt: 2 + device: 'cuda:1' + batch_size: 150 + shuffle_time: 1 + rollout_cnt: 1000 + train_freq: 1 + model_save_freq: 1 + gamma: 0.99 + learning_rate: 0.00005 + td_steps: 100 + entropy_loss_enable: True +model: + # path: '/data/log/20200119/demo_6p' + path: '/dcdata/log/test' + path: none + tick_buffer: 20 + hidden_size: 32 + graph_output_dim: 32 + action_dim: 21 + feature: + attention_order: temporal # meta_path_cnt, temporal or random + onehot_identity: False +log: + path: /dcdata/log/ + # be careful to turn this on + snapshot: True + exp: + enable: false + freq: 10 diff --git a/examples/ecr/gnn/differ_gnn_model.py b/examples/ecr/gnn/differ_gnn_model.py new file mode 100644 index 000000000..4601fe442 --- /dev/null +++ b/examples/ecr/gnn/differ_gnn_model.py @@ -0,0 +1,131 @@ +import torch +import torch.nn as nn +import torch.nn.functional as F +from .transformer import TransGAT, PositionalEncoder, GeLU, Norm +from torch.nn import TransformerEncoder, TransformerEncoderLayer +from torch.nn.modules.dropout import Dropout +# import numpy as np +# import datetime +class Header(nn.Module): + def __init__(self, input_size, hidden_size, output_size, net_type='res'): + super().__init__() + self.net_type = net_type + if net_type == 'res': + self.fc_0 = nn.Linear(input_size, hidden_size) + self.act_0 = GeLU() + # self.do_0 = Dropout(dropout) + self.fc_1 = nn.Linear(hidden_size, input_size) + self.act_1 = GeLU() + self.fc_2 = nn.Linear(input_size, output_size) + elif net_type == '2layer': + self.fc_0 = nn.Linear(input_size, hidden_size) + self.act_0 = GeLU() + # self.do_0 = Dropout(dropout) + self.fc_1 = nn.Linear(hidden_size, hidden_size//2) + self.act_1 = GeLU() + self.fc_2 = nn.Linear(hidden_size//2, output_size) + elif net_type == '1layer': + self.fc_0 = nn.Linear(input_size, hidden_size) + self.act_0 = GeLU() + self.fc_1 = nn.Linear(hidden_size, output_size) + + + def forward(self, x): + if self.net_type == 'res': + x1 = self.act_0(self.fc_0(x)) + x1 = self.act_1(self.fc_1(x1) + x) + return self.fc_2(x1) + elif self.net_type == '2layer': + x = self.act_0(self.fc_0(x)) + x = self.act_1(self.fc_1(x)) + x = self.fc_1(x) + return x + else: + x = self.fc_1(self.act_0(self.fc_0(x))) + return x + + +class SharedAC(nn.Module): + def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head='res'): + super().__init__() + assert(a or c) + self.a, self.c = a, c + self.input_dim_v = input_dim_v + self.input_dim_p = input_dim_p + self.tick_buffer = tick_buffer + + self.pre_dim_v, self.pre_dim_p = 8*scale, 16*scale + self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) + self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) + p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation='gelu', dim_feedforward=self.pre_dim_p*4) + v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation='gelu', dim_feedforward=self.pre_dim_v*4) + # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) + # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) + self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) + self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3) + + self.gnn_output_size = 32*scale + self.trans_gat = TransGAT( + p_dim=self.pre_dim_p, + v_dim=self.pre_dim_v, + output_size=self.gnn_output_size//2, + edge_dim={'p': edge_dim_p, 'v': edge_dim_v}, + layer_num=2 + ) + + # self.reduce_dim = nn.Linear(self.a_input, 2) + + if a: + self.policy_hidden_size = 16*scale + self.a_input = 3*self.gnn_output_size//2 + self.actor = nn.Sequential(Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), nn.Softmax(dim=-1)) + if c: + self.value_hidden_size = 16*scale + self.c_input = self.gnn_output_size + self.critic = Header(self.c_input, self.value_hidden_size, 1, ac_head) + + + def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): + assert((a and p_idx is not None and v_idx is not None) or c) + feature_p, feature_v = state['p'], state['v'] + + tb, bsize, p_cnt, _ = feature_p.shape + v_cnt = feature_v.shape[2] + assert(tb == self.tick_buffer) + + # before: feature_p.shape: (tick_buffer, batch_size, p_cnt, p_dim) + # after: feature_p.shape: (tick_buffer, batch_size*p_cnt, p_dim) + feature_p = self.p_pre_layer(feature_p.reshape(feature_p.shape[0], -1, feature_p.shape[-1])) + # state['mask']: (batch_size, tick_buffer) + # mask_p: (batch_size, p_cnt, tick_buffer) + mask_p = state['mask'].repeat(1, p_cnt).reshape(-1, self.tick_buffer) + feature_p = self.trans_layer_p(feature_p, src_key_padding_mask=mask_p) + + feature_v = self.v_pre_layer(feature_v.reshape(feature_v.shape[0], -1, feature_v.shape[-1])) + mask_v = state['mask'].repeat(1, v_cnt).reshape(-1, self.tick_buffer) + feature_v = self.trans_layer_v(feature_v, src_key_padding_mask=mask_v) + + feature_p = feature_p[0].reshape(bsize, p_cnt, self.pre_dim_p) + feature_v = feature_v[0].reshape(bsize, v_cnt, self.pre_dim_v) + + emb_p, emb_v = self.trans_gat(feature_p, state['pe'], feature_v, state['ve'], state['ppe']) + + # date_str = f"{datetime.datetime.now().strftime('%Y%m%d')}" + # time_str = f"{datetime.datetime.now().strftime('%H%M%S.%f')}" + # subfolder_name = '%s_%s'%('./visualization/graph_embedding_p.npy', time_str) + # np.save('%s_%s.npy'%('./visualization/emb/p_emb/emb', time_str), emb_p.cpu().detach().numpy()) + # np.save('%s_%s.npy'%('./visualization/emb/v_emb/emb', time_str), emb_v.cpu().detach().numpy()) + + a_rtn, c_rtn = None, None + if a and self.a: + ap = emb_p.reshape(bsize, p_cnt, self.gnn_output_size) + ap = ap[:, p_idx, :] + av = emb_v.reshape(bsize, v_cnt, self.gnn_output_size//2) + av = av[:, v_idx, :] + emb_a = torch.cat((ap, av), axis=1) + a_rtn = self.actor(emb_a) + if c and self.c: + c_rtn = self.critic(emb_p).reshape(bsize, p_cnt) + return a_rtn, c_rtn + + \ No newline at end of file diff --git a/examples/ecr/gnn/experience_shaper.py b/examples/ecr/gnn/experience_shaper.py new file mode 100644 index 000000000..748f3f384 --- /dev/null +++ b/examples/ecr/gnn/experience_shaper.py @@ -0,0 +1,102 @@ +import numpy as np +from collections import defaultdict +import pickle as pkl + +class ExperienceShaper: + def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, discount_factor=0.97, + idx=-1, shared_storage=None, exp_idx_mapping=None): + self._static_list = list(static_list) + self._dynamic_list = list(dynamic_list) + self._time_slot = time_slot + self._discount_factor = discount_factor + self._discount_vector = np.logspace(1, self._time_slot, self._time_slot, base=discount_factor) + self._max_tick = max_tick + self._tick_range = list(range(self._max_tick)) + self._len_return = self._max_tick - self._time_slot + self._gnn_state_shaper = gnn_state_shaper + self._fulfillment_list, self._shortage_list, self._experience_dict = None, None, None + self._experience_dict = defaultdict(list) + self._init_state() + self._idx = idx + self._exp_idx_mapping = exp_idx_mapping + self._shared_storage = shared_storage + self._scale_factor = scale_factor + + def _init_state(self): + self._fulfillment_list, self._shortage_list = np.zeros(self._max_tick+1), np.zeros(self._max_tick+1) + self._experience_dict = defaultdict(list) + self._last_tick = 0 + + def record(self, pending_action, model_action, model_input): + # only the experience that has the next state of given time slot is valuable + if pending_action.tick + self._time_slot < self._max_tick: + self._experience_dict[pending_action.port_idx, pending_action.vessel_idx].append({ + 'tick': pending_action.tick, + 's': model_input, + 'a': model_action, + }) + + def _compute_delta(self, arr): + delta = np.array(arr) + delta[1:] -= arr[:-1] + return delta + + def _batch_obs_to_numpy(self, obs): + v = np.stack([o['v'] for o in obs], axis=0) + p = np.stack([o['p'] for o in obs], axis=0) + vo = np.stack([o['vo'] for o in obs], axis=0) + po = np.stack([o['po'] for o in obs], axis=0) + return {'p': p, 'v': v, 'vo': vo, 'po': po} + + def __call__(self, snapshot_list): + if self._shared_storage is None: + return + + shortage = snapshot_list["ports"][self._tick_range:self._static_list:"shortage"].reshape(self._max_tick, -1) + fulfillment = snapshot_list["ports"][self._tick_range:self._static_list:"fulfillment"].reshape(self._max_tick, -1) + # tot_shortage = np.sum(shortage, axis=1) + # tot_fulfillment = np.sum(fulfillment, axis=1) + delta = fulfillment - shortage + R = np.empty((self._len_return, len(self._static_list)), dtype=np.float) + for i in range(0, self._len_return, 1): + R[i] = np.dot(self._discount_vector, delta[i+1: i+self._time_slot+1]) + + # pkl.dump(R, open(r'/data/log/replay/R2.pkl', 'wb')) + + for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): + for exp in exp_list: + tick = exp['tick'] + exp['s_'] = self._gnn_state_shaper(tick=tick+self._time_slot) + exp['R'] = self._scale_factor*R[tick] + + tmpi = 0 + for (agent_idx, vessel_idx), idx_base in self._exp_idx_mapping.items(): + # for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): + exp_list = self._experience_dict[(agent_idx, vessel_idx)] + exp_len = len(exp_list) + # here, we assume that exp_idx_mapping order is not changed. + self._shared_storage['len'][self._idx, tmpi] = exp_len + self._shared_storage['s']['v'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['v'] for e in exp_list], axis=1) + self._shared_storage['s']['p'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['p'] for e in exp_list], axis=1) + self._shared_storage['s']['vo'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['vo'] for e in exp_list], axis=0) + self._shared_storage['s']['po'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['po'] for e in exp_list], axis=0) + self._shared_storage['s']['vedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['vedge'] for e in exp_list], axis=0) + self._shared_storage['s']['pedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['pedge'] for e in exp_list], axis=0) + + self._shared_storage['s_']['v'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['v'] for e in exp_list], axis=1) + self._shared_storage['s_']['p'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['p'] for e in exp_list], axis=1) + self._shared_storage['s_']['vo'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['vo'] for e in exp_list], axis=0) + self._shared_storage['s_']['po'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['po'] for e in exp_list], axis=0) + self._shared_storage['s_']['vedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['vedge'] for e in exp_list], axis=0) + self._shared_storage['s_']['pedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['pedge'] for e in exp_list], axis=0) + + self._shared_storage['a'][idx_base:idx_base+exp_len, self._idx] = np.array([exp['a'] for exp in exp_list], dtype=np.int64) + self._shared_storage['R'][idx_base:idx_base+exp_len, self._idx] = np.vstack([exp['R'] for exp in exp_list]) + tmpi += 1 + + # pkl.dump(self._exp_idx_mapping, open(r'/data/log/replay/order2.pkl', 'wb')) + # pkl.dump(self._shared_storage, open(r'/data/log/replay/22p2.pkl', 'wb')) + + def reset(self): + del self._experience_dict + self._init_state() diff --git a/examples/ecr/gnn/launcher.py b/examples/ecr/gnn/launcher.py new file mode 100644 index 000000000..e1bb3a3c9 --- /dev/null +++ b/examples/ecr/gnn/launcher.py @@ -0,0 +1,77 @@ +import time, os +import torch +from examples.ecr.gnn.numpy_store import NumpyStore, Shuffler +import numpy as np +from examples.ecr.gnn.experience_shaper import ExperienceShaper +import multiprocessing +from collections import defaultdict +from examples.ecr.gnn.actor import ParallelActor +from examples.ecr.gnn.learner import GNNLearner +from maro.simulator import Env +from examples.ecr.gnn.state_shaper import GNNStateShaper +from examples.ecr.gnn.utils import decision_cnt_analysis, load_config, save_config, save_code, return_scaler +from examples.ecr.gnn.agent_manager import SimpleAgentManger +from maro.utils import Logger, LogFormat +import datetime +import time + + +if __name__ == "__main__": + config_pth = 'examples/ecr/gnn/config_22p.yml' + config = load_config(config_pth) + + # generate log path. + date_str = f"{datetime.datetime.now().strftime('%Y%m%d')}" + time_str = f"{datetime.datetime.now().strftime('%H%M%S.%f')}" + subfolder_name = '%s_%s'%(config.env.param.topology, time_str) + + # log path. + config.log.path = os.path.join(config.log.path, date_str, subfolder_name) + if not os.path.exists(config.log.path): + os.makedirs(config.log.path) + + simulation_logger = Logger(tag='simulation', dump_folder=config.log.path, dump_mode='w', auto_timestamp=False) + + # create a demo environment to retrieve environment information. + simulation_logger.info("Approximating the experience quantity of each agent...") + demo_env = Env(**config.env.param) + config.env.exp_per_ep = decision_cnt_analysis(demo_env, pv=True, buffer_size=8) + simulation_logger.info(config.env.exp_per_ep) + + # add some buffer to prevent overlapping + config.env.return_scaler, tot_order_amount = return_scaler(demo_env, tick=config.env.param.durations, + gamma=config.training.gamma) + simulation_logger.info("Return value will be scaled down by the factor %f"%config.env.return_scaler) + + save_config(config, os.path.join(config.log.path, 'config.yml')) + save_code('examples/ecr/gnn',config.log.path) + + port_mapping = demo_env.summary['node_mapping']['ports'] + vessel_mapping = demo_env.summary['node_mapping']['vessels'] + + # create a mock gnn_state_shaper. + static_code_list, dynamic_code_list = list(port_mapping.values()), list(vessel_mapping.values()) + gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, + config.model.feature, tick_buffer=config.model.tick_buffer, only_demo=True, + max_value=demo_env.configs['total_containers']) + gnn_state_shaper.compute_static_graph_structure(demo_env) + + # create and assemble agent_manager + agent_id_list = list(config.env.exp_per_ep.keys()) + training_logger = Logger(tag='training', dump_folder=config.log.path, dump_mode='w', auto_timestamp=False) + agent_manager = SimpleAgentManger("ecr-GNN-ma", agent_id_list, static_code_list, dynamic_code_list, demo_env, + gnn_state_shaper, training_logger) + agent_manager.assemble(config) + + if os.path.exists(config.model.path): + agent_manager.load_models_from(config.model.path) + + # create the rollout actor to collect experience. + actor = ParallelActor(config, demo_env, gnn_state_shaper, agent_manager, logger=simulation_logger) + + # learner function for training and testing. + learner = GNNLearner(actor, agent_manager, logger=simulation_logger) + learner.train(config.training) + + # cancel all the child process used for rollout. + actor.exit() \ No newline at end of file diff --git a/examples/ecr/gnn/learner.py b/examples/ecr/gnn/learner.py new file mode 100644 index 000000000..8ae7b4eb8 --- /dev/null +++ b/examples/ecr/gnn/learner.py @@ -0,0 +1,52 @@ +from maro.rl import AbsLearner +from maro.rl import AbsActor +from maro.rl import AbsAgentManager +from maro.utils import DummyLogger +import time +import os + +class GNNLearner(AbsLearner): + def __init__(self, actor: AbsActor, trainable_agents:AbsAgentManager, logger=DummyLogger()): + """Learner class for the training pipeline and the specialized logging in GNN solution for ECR problem. + + Args: + actor (AbsActor): The actor instance to collect experience. + trainable_agents (AbsAgentManager): The agent manager for training RL models. + logger (Logger) + """ + self._actor = actor + self._trainable_agents = trainable_agents + self._logger = logger + + def train(self, training_config, log_pth=None): + rollout_time = 0 + training_time = 0 + for i in range(training_config.rollout_cnt): + self._logger.info('rollout %d'%(i+1)) + tick = time.time() + exp_dict = self._actor.roll_out() + + rollout_time += time.time() - tick + + self._logger.info('start putting exps') + self._trainable_agents.store_experiences(exp_dict) + + if training_config.enable and i % training_config.train_freq == training_config.train_freq-1: + tick = time.time() + + # for code, exp_pool in experience_pool_dict.items(): + loss_dict = self._trainable_agents.train(training_config) + + training_time += time.time() - tick + self._logger.info() + + + if log_pth is not None and (i+1) % training_config.model_save_freq == 0: + self._actor.save_model(os.path.join(log_pth, 'models'), i+1) + + self._logger.debug('tot rollout_time: %d' % int(rollout_time)) + self._logger.debug('train_time: %d' % int(training_time)) + + + def test(self): + pass \ No newline at end of file diff --git a/examples/ecr/gnn/numpy_store.py b/examples/ecr/gnn/numpy_store.py new file mode 100644 index 000000000..f322acffd --- /dev/null +++ b/examples/ecr/gnn/numpy_store.py @@ -0,0 +1,187 @@ +import numpy as np +from maro.rl import AbsStore +from typing import Sequence + + +def get_item(data_dict, key_tuple): + '''Helper function to get the value in a hierarchical dictionary given the key path. + + Args: + data_dict (dict): The data structure. For example: + { + 'a': { + 'b': 1, + 'c': { + 'd': 2, + } + } + } + + key_tuple (tuple): The key path to the target field. For example, given the data_dict above, the key_tuple + ('a', 'c', 'd') should return 2. + ''' + for key in key_tuple: + data_dict = data_dict[key] + return data_dict + + +def set_item(data_dict, key_tuple, data): + '''The setter function corresponding to the get_item function. + ''' + for i, key in enumerate(key_tuple): + if key not in data_dict: + data_dict[key] = {} + if i == len(key_tuple) - 1: + data_dict[key] = data + else: + data_dict = data_dict[key] + + +class NumpyStore(AbsStore): + def __init__(self, domain_type_dict, capacity): + """ + Args: + domain_type_dict (dict): The dictionary describing the name, structure and type of each field in the + experience. Each field in the experience is the key-value pair in the folowing structure: + (field_name): (size_of_an_instance, data_type, batch_first) + + For example: + ('s'): ((32, 64), np.float32, True) + + The field can be a hierarchical dictionary by identifying the full path to the root. + + For example: + { + ('s', 'p'): ((32, 64), np.float32, True) + ('s', 'v'): ((48, ), np.float32, False), + } + Then the batch of experience returned by self.get(indexes) is: + { + 's': + { + 'p': numpy.array with size (batch, 32, 64), + 'v': numpy.array with size (32, batch, 48), + } + } + Note that for the field ('s', 'v'), the batch is in the 2nd dimension because the batch_first attribute + is False. + + capacity (int): The maximum stored experience in the store. + """ + self.domain_type_dict = dict(domain_type_dict) + self.store = {key: np.zeros(shape=(capacity, *shape) if batch_first else (shape[0], capacity, *shape[1:]), dtype=data_type) + for key, (shape, data_type, batch_first) in domain_type_dict.items()} + self.batch_first_store = {key: batch_first for key, (_, _, batch_first) in domain_type_dict.items()} + + self.cnt = 0 + self.capacity = capacity + + + def put(self, exp_dict: dict): + """Insert a batch of experience into the store + + If the store reaches the maximum capacity, this function will replace the experience in the store randomly. + + Args: + exp_dict (dict): The dictionary of a batch of experience. For example: + + { + 's': + { + 'p': numpy.array with size (batch, 32, 64), + 'v': numpy.array with size (32, batch, 48), + } + } + + The structure should be consistent with the structure defined in the __init__ function. + + Returns: + indexes (numpy.array): The list of the indexes each experience in the batch is located in. + """ + + dlen = exp_dict['len'] + append_end = min(max(self.capacity - self.cnt, 0), dlen) + idxs = np.zeros(dlen, dtype=np.int) + if append_end != 0: + for key in self.domain_type_dict.keys(): + data = get_item(exp_dict, key) + if self.batch_first_store[key]: + self.store[key][self.cnt: self.cnt+append_end] = data[0:append_end] + else: + self.store[key][:, self.cnt: self.cnt+append_end] = data[:, 0:append_end] + idxs[: append_end] = np.arange(self.cnt, self.cnt+append_end) + if append_end < dlen: + replace_idx = self._get_replace_idx(dlen - append_end) + for key in self.domain_type_dict.keys(): + data = get_item(exp_dict, key) + if self.batch_first_store[key]: + self.store[key][replace_idx] = data[append_end: dlen] + else: + self.store[key][:, replace_idx] = data[:, append_end: dlen] + idxs[append_end: dlen] = replace_idx + self.cnt += dlen + return idxs + + def _get_replace_idx(self, cnt): + return np.random.randint(low=0, high=self.capacity, size=cnt) + + def get(self, indexes:np.array): + """Get the experience indexed in the indexes list from the store + + Args: + indexes (np.array): A numpy array containing the indexes of a batch experience. + + Returns: + data_dict (dict): the structure same as that defined in the __init__ function. + """ + data_dict = {} + for key in self.domain_type_dict.keys(): + if self.batch_first_store[key]: + set_item(data_dict, key, self.store[key][indexes]) + else: + set_item(data_dict, key, self.store[key][:, indexes]) + return data_dict + + def __len__(self): + return min(self.capacity, self.cnt) + + def update(self, indexes: Sequence, contents: Sequence): + raise NotImplementedError("NumpyStore does not support modifying the experience!") + + def sample(self, size, replace: bool = True): + raise NotImplementedError("NumpyStore does not support sampling. Please use outer sampler to fetch samples!") + + def clear(self): + """Remove all the experience in the store. + """ + self.cnt = 0 + + +class Shuffler: + def __init__(self, store: NumpyStore, batch_size: int): + """The helper class for fast batch sampling. + + Args: + store (NumpyStore): The data source for sampling. + batch_size (int): The size of a batch. + """ + self._store = store + self._shuffled_seq = np.arange(0, len(store)) + np.random.shuffle(self._shuffled_seq) + self._start = 0 + self._batch_size = batch_size + + def next(self): + """Uniformly sampling out a batch in the store. + """ + if self._start >= len(self._store): + return None + end = min(self._start + self._batch_size, len(self._store)) + rst = self._store.get(self._shuffled_seq[self._start: end]) + self._start += self._batch_size + return rst + + def has_next(self): + """Check if any experience is not visited. + """ + return self._start < len(self._store) \ No newline at end of file diff --git a/examples/ecr/gnn/shared_structure.py b/examples/ecr/gnn/shared_structure.py new file mode 100644 index 000000000..32713f336 --- /dev/null +++ b/examples/ecr/gnn/shared_structure.py @@ -0,0 +1,38 @@ +import multiprocessing +import numpy as np + +def init_shared_memory(data_structure): + # data_structure should be a dict like: + # { + # 'a': (shape, type), + # 'b': { + # 'b1': (shape, type), + # } + # } + if isinstance(data_structure, tuple): + mult = 1 + for i in data_structure[0]: + mult *= i + return multiprocessing.Array(data_structure[1], mult, lock=False) + else: + shared_data = {} + for k, v in data_structure.items(): + shared_data[k] = init_shared_memory(v) + return shared_data + +def shared_data2numpy(shared_data, structure_info): + if not isinstance(shared_data, dict): + return np.frombuffer(shared_data, dtype=structure_info[1]).reshape(structure_info[0]) + else: + numpy_dict = {} + for k, v in shared_data.items(): + numpy_dict[k] = shared_data2numpy(v, structure_info[k]) + return numpy_dict + +class SharedStructure: + def __init__(self, data_structure): + self.data_structure = data_structure + self.shared = init_shared_memory(data_structure) + + def structuralize(self): + return shared_data2numpy(self.shared, self.data_structure) \ No newline at end of file diff --git a/examples/ecr/gnn/simple_gnn.py b/examples/ecr/gnn/simple_gnn.py new file mode 100644 index 000000000..d31474ad3 --- /dev/null +++ b/examples/ecr/gnn/simple_gnn.py @@ -0,0 +1,329 @@ +import torch +from torch import Tensor +import copy +import torch.nn as nn +import math +from torch.autograd import Variable +from torch.nn import functional as F + +# lib for transformer +from torch.nn.modules.module import Module +from torch.nn.modules.activation import MultiheadAttention +from torch.nn.modules.container import ModuleList +from torch.nn.init import xavier_uniform_ +from torch.nn.modules.dropout import Dropout +from torch.nn.modules.linear import Linear +from torch.nn.modules.normalization import LayerNorm +from torch.nn import TransformerEncoder, TransformerEncoderLayer + +class PositionalEncoder(nn.Module): + ''' + The positional encoding used in transformer to get the sequential information. + + The code is based on the PyTorch version in web + https://pytorch.org/tutorials/beginner/transformer_tutorial.html?highlight=positionalencoding + ''' + + def __init__(self, d_model, max_seq_len = 80): + super().__init__() + self.d_model = d_model + self.times = 4*math.sqrt(self.d_model) + + # create constant 'pe' matrix with values dependant on + # pos and i + self.pe = torch.zeros(max_seq_len, d_model) + for pos in range(max_seq_len): + for i in range(0, d_model, 2): + self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i)/d_model))) + self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1))/d_model))) + + self.pe = self.pe.unsqueeze(1)/self.d_model + + def forward(self, x): + # make embeddings relatively larger + # x = x * self.sqrt_d_model + # add constant to embedding + addon = self.pe[:x.shape[0], :, :x.shape[2]].to(x.get_device()) + return x+addon + +class SimpleGATLayer(nn.Module): + """The enhanced graph attention layer for heterogenenous neighborhood. + + It first utilizes pre-layers for both the source and destination node to map their features into the same hidden + size. If the edge also has features, they are concatenated with those of the corresponding source node before being + fed to the pre-layers. Then the graph attention(https://arxiv.org/abs/1710.10903) is done to aggregate information + from the source nodes to the destination nodes. The residual connection and layer normalization are also used to + enhance the performance, which is similar to the Transformer(https://arxiv.org/abs/1706.03762). + + Args: + src_dim (int): The feature dimension of the source nodes. + dest_dim (int): The feature dimension of the destination nodes. + edge_dim (int): The feature dimension of the edges. If the edges have no feature, it should be set 0. + hidden_size (int): The hidden size both the destination and source is mapped into. + nhead (int): The number of head in the multi-head attention. + position_encoding (bool): the neighbor source nodes is aggregated in order(True) or orderless(False). + """ + + def __init__(self, src_dim, dest_dim, edge_dim, hidden_size, nhead=4, position_encoding=True): + super().__init__() + self.src_dim = src_dim + self.dest_dim = dest_dim + self.edge_dim = edge_dim + self.hidden_size = hidden_size + self.nhead = nhead + src_layers = [] + src_layers.append(nn.Linear(src_dim+edge_dim, hidden_size)) + src_layers.append(GeLU()) + self.src_pre_layer = nn.Sequential(*src_layers) + + dest_layers = [] + dest_layers.append(nn.Linear(dest_dim, hidden_size)) + dest_layers.append(GeLU()) + self.dest_pre_layer = nn.Sequential(*dest_layers) + + self.att = MultiheadAttention(embed_dim=hidden_size, num_heads=nhead) + self.att_dropout = Dropout(0.1) + self.att_norm = LayerNorm(hidden_size) + + self.zero_padding_template = torch.zeros((1, src_dim), dtype=torch.float) + + def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor=None): + """Information aggregation from the source nodes to the destination nodes. + + Args: + src (Tensor): The source nodes in a batch of graph. + dest (Tensor): The destination nodes in a batch of graph. + adj (Tensor): The adjencency list stored in a 2D matrix in the batch-second format. The first dimension is + the maximum amount of the neighbors the destinations have. As the neighbor quantities vary from one + destination to another, the short sequences are padded with 0. + mask (Tensor): The mask identifies if a position in the adj is padded. Note that it is stored in the + batch-first format. + + Returns: + destination_emb: The embedding of the destinations after the GAT layer. + + Shape: + src: (batch, src_cnt, src_dim) + dest: (batch, dest_cnt, dest_dim) + adj: (src_neighbor_cnt, batch*dest_cnt) + mask: (batch*dest_cnt)*src_neighbor_cnt + edges: (batch*dest_cnt, src_neighbor_cnt, edge_dim) + destination_emb: (batch, dest_cnt, hidden_size) + + """ + assert(self.src_dim == src.shape[-1]) + assert(self.dest_dim== dest.shape[-1]) + batch, s_cnt, src_dim = src.shape + batch, d_cnt, dest_dim = dest.shape + src_neighbor_cnt = adj.shape[0] + + src_embedding = src.reshape(-1, src_dim) + src_embedding = torch.cat((self.zero_padding_template.to(src_embedding.get_device()), src_embedding)) + + # adj = adj[:,torch.randperm(adj.size()[1])] + flat_adj = adj.reshape(-1) + # src_cnt * (batch * dest_cnt) * src_dim + src_embedding = src_embedding[flat_adj].reshape(src_neighbor_cnt, -1, src_dim) + if edges is not None: + src_embedding = torch.cat((src_embedding, edges), axis=2) + + src_input = self.src_pre_layer(src_embedding.reshape(-1, src_dim+self.edge_dim)).reshape(*src_embedding.shape[:2], self.hidden_size) + dest_input = self.dest_pre_layer(dest.reshape(-1, dest_dim)).reshape(1, batch*d_cnt, self.hidden_size) + dest_emb, _ = self.att(dest_input, src_input, src_input, key_padding_mask=mask) + + dest_emb = dest_emb + self.att_dropout(dest_emb) + dest_emb = self.att_norm(dest_emb) + return dest_emb.reshape(batch, d_cnt, self.hidden_size) + +class SimpleGAT(nn.Module): + """Graph attention network with multiple graph in the ECR scenario. + + This module aggregates information in the port-to-port graph, port-to-vessel graph and vessel-to-port graph. The + aggregation in the two graph are done separatedly and then the port features are concatenated as the final result. + + Args: + p_dim (int): The feature dimension of the ports. + v_dim (int): The feature dimension of the vessels. + edge_dim (dict): The key is the edge name and the value is the corresponding feature dimension. + output_size (int): The hidden size in graph attention. + layer_num (int): The number of graph attention layers in each graph. + """ + + def __init__(self, p_dim, v_dim, edge_dim:dict, output_size, layer_num=2): + super().__init__() + self.hidden_size = output_size + self.layer_num = layer_num + + pl, vl, ppl = [], [], [] + for i in range(layer_num): + if i==0: + pl.append(SimpleGATLayer(v_dim, p_dim, edge_dim['v'], self.hidden_size, nhead=4)) + vl.append(SimpleGATLayer(p_dim, v_dim, edge_dim['v'], self.hidden_size, nhead=4)) + # p2p links + ppl.append(SimpleGATLayer(p_dim, p_dim, edge_dim['p'], self.hidden_size, nhead=4, position_encoding=False)) + else: + pl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) + if i != layer_num - 1: + # p2v conv is not necessary at the last layer, for we only use port features + vl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) + ppl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, position_encoding=False)) + self.p_layers = nn.ModuleList(pl) + self.v_layers = nn.ModuleList(vl) + self.pp_layers = nn.ModuleList(ppl) + + def forward(self, p, pe, v, ve, ppe): + """Do the multi-channel graph attention. + + Args: + p (Tensor): The port feature. + pe (Tensor): The vessel-port edge feature. + v (Tensor): The vessel feature. + ve (Tensor): The port-vessel edge feature. + ppe (Tensor): The port-port edge feature. + """ + # p.shape: (batch*p_cnt, p_dim) + pp = p + pre_p, pre_v, pre_pp = p, v, pp + for i in range(self.layer_num): + # only feed edge info in the first layer + p = self.p_layers[i](pre_v, pre_p, adj=pe['adj'], edges=pe['edge'] if i==0 else None, mask=pe['mask']) + if i != self.layer_num - 1: + v = self.v_layers[i](pre_p, pre_v, adj=ve['adj'], edges=ve['edge'] if i==0 else None, mask=ve['mask']) + pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe['adj'], edges=ppe['edge'] if i==0 else None, mask=ppe['mask']) + pre_p, pre_v, pre_pp = p, v, pp + p = torch.cat((p, pp), axis=2) + return p, v + +class GeLU(nn.Module): + """Simple gelu wrapper as a independent module. + """ + def __init__(self): + super().__init__() + + def forward(self, input): + return F.gelu(input) + + +class Header(nn.Module): + def __init__(self, input_size, hidden_size, output_size, net_type='res'): + super().__init__() + self.net_type = net_type + if net_type == 'res': + self.fc_0 = nn.Linear(input_size, hidden_size) + self.act_0 = GeLU() + # self.do_0 = Dropout(dropout) + self.fc_1 = nn.Linear(hidden_size, input_size) + self.act_1 = GeLU() + self.fc_2 = nn.Linear(input_size, output_size) + elif net_type == '2layer': + self.fc_0 = nn.Linear(input_size, hidden_size) + self.act_0 = GeLU() + # self.do_0 = Dropout(dropout) + self.fc_1 = nn.Linear(hidden_size, hidden_size//2) + self.act_1 = GeLU() + self.fc_2 = nn.Linear(hidden_size//2, output_size) + elif net_type == '1layer': + self.fc_0 = nn.Linear(input_size, hidden_size) + self.act_0 = GeLU() + self.fc_1 = nn.Linear(hidden_size, output_size) + + + def forward(self, x): + if self.net_type == 'res': + x1 = self.act_0(self.fc_0(x)) + x1 = self.act_1(self.fc_1(x1) + x) + return self.fc_2(x1) + elif self.net_type == '2layer': + x = self.act_0(self.fc_0(x)) + x = self.act_1(self.fc_1(x)) + x = self.fc_1(x) + return x + else: + x = self.fc_1(self.act_0(self.fc_0(x))) + return x + + +class SharedAC(nn.Module): + def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head='res'): + super().__init__() + assert(a or c) + self.a, self.c = a, c + self.input_dim_v = input_dim_v + self.input_dim_p = input_dim_p + self.tick_buffer = tick_buffer + + self.pre_dim_v, self.pre_dim_p = 8*scale, 16*scale + self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) + self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) + p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation='gelu', dim_feedforward=self.pre_dim_p*4) + v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation='gelu', dim_feedforward=self.pre_dim_v*4) + # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) + # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) + self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) + self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3) + + self.gnn_output_size = 32*scale + self.trans_gat = SimpleGAT( + p_dim=self.pre_dim_p, + v_dim=self.pre_dim_v, + output_size=self.gnn_output_size//2, + edge_dim={'p': edge_dim_p, 'v': edge_dim_v}, + layer_num=2 + ) + + # self.reduce_dim = nn.Linear(self.a_input, 2) + + if a: + self.policy_hidden_size = 16*scale + self.a_input = 3*self.gnn_output_size//2 + self.actor = nn.Sequential(Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), nn.Softmax(dim=-1)) + if c: + self.value_hidden_size = 16*scale + self.c_input = self.gnn_output_size + self.critic = Header(self.c_input, self.value_hidden_size, 1, ac_head) + + + def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): + assert((a and p_idx is not None and v_idx is not None) or c) + feature_p, feature_v = state['p'], state['v'] + + tb, bsize, p_cnt, _ = feature_p.shape + v_cnt = feature_v.shape[2] + assert(tb == self.tick_buffer) + + # before: feature_p.shape: (tick_buffer, batch_size, p_cnt, p_dim) + # after: feature_p.shape: (tick_buffer, batch_size*p_cnt, p_dim) + feature_p = self.p_pre_layer(feature_p.reshape(feature_p.shape[0], -1, feature_p.shape[-1])) + # state['mask']: (batch_size, tick_buffer) + # mask_p: (batch_size, p_cnt, tick_buffer) + mask_p = state['mask'].repeat(1, p_cnt).reshape(-1, self.tick_buffer) + feature_p = self.trans_layer_p(feature_p, src_key_padding_mask=mask_p) + + feature_v = self.v_pre_layer(feature_v.reshape(feature_v.shape[0], -1, feature_v.shape[-1])) + mask_v = state['mask'].repeat(1, v_cnt).reshape(-1, self.tick_buffer) + feature_v = self.trans_layer_v(feature_v, src_key_padding_mask=mask_v) + + feature_p = feature_p[0].reshape(bsize, p_cnt, self.pre_dim_p) + feature_v = feature_v[0].reshape(bsize, v_cnt, self.pre_dim_v) + + emb_p, emb_v = self.trans_gat(feature_p, state['pe'], feature_v, state['ve'], state['ppe']) + + # date_str = f"{datetime.datetime.now().strftime('%Y%m%d')}" + # time_str = f"{datetime.datetime.now().strftime('%H%M%S.%f')}" + # subfolder_name = '%s_%s'%('./visualization/graph_embedding_p.npy', time_str) + # np.save('%s_%s.npy'%('./visualization/emb/p_emb/emb', time_str), emb_p.cpu().detach().numpy()) + # np.save('%s_%s.npy'%('./visualization/emb/v_emb/emb', time_str), emb_v.cpu().detach().numpy()) + + a_rtn, c_rtn = None, None + if a and self.a: + ap = emb_p.reshape(bsize, p_cnt, self.gnn_output_size) + ap = ap[:, p_idx, :] + av = emb_v.reshape(bsize, v_cnt, self.gnn_output_size//2) + av = av[:, v_idx, :] + emb_a = torch.cat((ap, av), axis=1) + a_rtn = self.actor(emb_a) + if c and self.c: + c_rtn = self.critic(emb_p).reshape(bsize, p_cnt) + return a_rtn, c_rtn + + \ No newline at end of file diff --git a/examples/ecr/gnn/state_shaper.py b/examples/ecr/gnn/state_shaper.py new file mode 100644 index 000000000..b131a6a07 --- /dev/null +++ b/examples/ecr/gnn/state_shaper.py @@ -0,0 +1,237 @@ +import numpy as np +import torch +import pickle as pkl +from .utils import compute_v2p_degree_matrix + +class GNNStateShaper: + def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, + attention_order='temporal', tick_buffer=20, only_demo=False): + # collect and encode all ports + self.port_code_list = list(port_code_list) + self.port_cnt = len(self.port_code_list) + self.port_code_inv_dict = {code: i for i, code in enumerate(self.port_code_list)} + + # collect and encode all vessels + self.vessel_code_list = list(vessel_code_list) + self.vessel_cnt = len(self.vessel_code_list) + self.vessel_code_inv_dict = {code: i for i, code in enumerate(self.vessel_code_list)} + + # collect and encode ports and vessels together + self.node_code_inv_dict_p = {i: i for i in self.port_code_list} + self.node_code_inv_dict_v = {i: i+self.port_cnt for i in self.vessel_code_list} + self.node_cnt = self.port_cnt + self.vessel_cnt + + one_hot_coding = np.identity(self.node_cnt) + self.port_one_hot_coding = np.expand_dims(one_hot_coding[:self.port_cnt], axis=0) + self.vessel_one_hot_coding = np.expand_dims(one_hot_coding[self.port_cnt:], axis=0) + self.last_tick = -1 + + self.port_features = ['empty', 'full', 'capacity', + 'on_shipper', + 'on_consignee', 'booking', 'acc_booking', 'shortage', 'acc_shortage', + 'fulfillment', 'acc_fulfillment'] + self.vessel_features = ['empty', 'full', 'capacity', 'remaining_space'] + + self._max_tick = max_tick + self._tick_buffer = tick_buffer + self._attention_order = attention_order + # to identify one vessel would never arrive at the port + self.max_arrival_time = 99999999 + + self.vedge_dim = 2 + self.pedge_dim = 1 + + self._only_demo = only_demo + self._feature_config = feature_config + self._normalize = True + self._norm_scale = 2.0/max_value + if not only_demo: + self._state_dict = { + # last 'tick' is used for embedding, all zero and never be modified. + 'v': np.zeros((self._max_tick+1, self.vessel_cnt, self.get_input_dim('v'))), + 'p': np.zeros((self._max_tick+1, self.port_cnt, self.get_input_dim('p'))), + 'vo': np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt), dtype=np.int), + 'po': np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt), dtype=np.int), + 'vedge': np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt, self.get_input_dim('vedge'))), + 'pedge': np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt, self.get_input_dim('vedge'))), + 'ppedge': np.zeros((self._max_tick+1, self.port_cnt, self.port_cnt, self.get_input_dim('pedge'))), + } + + # fixed order: in the order of degree + + def compute_static_graph_structure(self, env): + v2p_adj_matrix = compute_v2p_degree_matrix(env) + p2p_adj_matrix = np.dot(v2p_adj_matrix.T, v2p_adj_matrix) + p2p_adj_matrix[p2p_adj_matrix==0] = self.max_arrival_time + np.fill_diagonal(p2p_adj_matrix, self.max_arrival_time) + self._p2p_embedding = self.sort(p2p_adj_matrix) + + v2p_adj_matrix = -v2p_adj_matrix + v2p_adj_matrix[v2p_adj_matrix == 0] = self.max_arrival_time + self._fixed_v_order = self.sort(v2p_adj_matrix) + self._fixed_p_order = self.sort(v2p_adj_matrix.T) + + @property + def p2p_static_graph(self): + return self._p2p_embedding + + def sort(self, arrival_time, attr=None): + ''' + given the arrival time matrix, this function sort the matrix and return the index matrix in the order of arrival time + ''' + n, m = arrival_time.shape + if self._feature_config.attention_order == 'ramdom': + arrival_time = arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape) + at_index = np.argsort(arrival_time, axis=1) + if attr is not None: + idx_tmp = np.repeat(at_index, attr.shape[-1]).reshape(*at_index.shape, attr.shape[-1]) + attr = np.take_along_axis(attr, idx_tmp, axis=1) + mask = np.sort(arrival_time, axis=1) >= self.max_arrival_time + at_index += 1 + at_index[mask] = 0 + if attr is None: + return at_index + else: + return at_index, attr + + def arg_idx(self, arrival_time, p_or_v): + if self._feature_config.attention_order == 'temporal': + return self.sort(arrival_time) + elif self._feature_config.attention_order == 'meta_path_cnt': + return self._fixed_p_order if p_or_v else self._fixed_v_order + else: + # randomize the arrival time + return self.sort(arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape)) + + def end_ep_callback(self, snapshot_list): + if self._only_demo: + return + tick_range = np.arange(start=self.last_tick, stop=self._max_tick) + self._sync_raw_features(snapshot_list, list(tick_range)) + + port_features = snapshot_list["ports"][list(range(self._max_tick)):self.port_code_list: self.port_features] \ + .reshape(self._max_tick, self.port_cnt, -1) + # pkl.dump(port_features, open('/data/log/replay/snapshot.pkl', 'wb')) + self.last_tick = -1 + + def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): + ''' + this function update the state_dict from snapshot_list in the given tick_range + ''' + if len(tick_range) == 0: + # this occurs when two actions happen at the same tick + return + + # one dim features + port_naive_feature = snapshot_list["ports"][tick_range: self.port_code_list: self.port_features] \ + .reshape(len(tick_range), self.port_cnt, -1) + # number of laden from source to destination + full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape(len(tick_range), self.port_cnt, self.port_cnt) + # normalize features to a small range + # port_state_mat = self.normalize(np.concatenate([port_naive_feature, full_on_port], axis=2)) + port_state_mat = self.normalize(port_naive_feature) + + if self._feature_config.onehot_identity: + # add onehot vector to identify port and vessel + port_onehot = np.repeat(self.port_one_hot_coding, len(tick_range), axis=0) + if static_code is not None and dynamic_code is not None: + # identify the decision vessel at the decision port + # print(dynamic_code, self.node_code_inv_dict_v[dynamic_code]) + port_onehot[-1, self.port_code_inv_dict[static_code], self.node_code_inv_dict_v[dynamic_code]] = -1 + port_state_mat = np.concatenate([port_state_mat, port_onehot], axis=2) + self._state_dict['p'][tick_range] = port_state_mat + + vessel_naive_feature = snapshot_list["vessels"][tick_range:self.vessel_code_list: self.vessel_features] \ + .reshape(len(tick_range), self.vessel_cnt, -1) + full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape(len(tick_range), self.vessel_cnt, self.port_cnt) + + # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) + vessel_state_mat = self.normalize(vessel_naive_feature) + if self._feature_config.onehot_identity: + vessel_state_mat = np.concatenate([vessel_state_mat, np.repeat(self.vessel_one_hot_coding, len(tick_range), axis=0)], axis=2) + self._state_dict['v'][tick_range] = vessel_state_mat + + # last_arrival_time.shape: vessel_cnt * port_cnt + # -1 means one vessel never stops at the port + vessel_arrival_time = snapshot_list["matrices"][tick_range[-1]:: "vessel_plans"].reshape(self.vessel_cnt, self.port_cnt) + # use infinity time to identify vessels never arrive at the port + last_arrival_time = vessel_arrival_time + 1 + last_arrival_time[last_arrival_time==0] = self.max_arrival_time + if static_code is not None and dynamic_code is not None: + # to differentiate vessel acting on the port and other vessels that have taken or wait to take actions. + last_arrival_time[self.vessel_code_inv_dict[dynamic_code], self.port_code_inv_dict[static_code]] = 0 + + # here, we assume that the order of arriving time between two action/event is all the same. + vedge_raw = self.normalize(np.stack((full_on_vessel[-1], last_arrival_time), axis=-1)) + vo, vedge = self.sort(last_arrival_time, attr=vedge_raw) + po, pedge = self.sort(last_arrival_time.T, attr=vedge_raw.transpose((1,0,2))) + self._state_dict['vo'][tick_range] = np.expand_dims(vo, axis=0) + self._state_dict['vedge'][tick_range] = np.expand_dims(vedge, axis=0) + self._state_dict['po'][tick_range] = np.expand_dims(po, axis=0) + self._state_dict['pedge'][tick_range] = np.expand_dims(pedge, axis=0) + self._state_dict['ppedge'][tick_range] = self.normalize(full_on_port[-1]).reshape(1, *full_on_port[-1].shape, 1) + + + def __call__(self, action_info=None, snapshot_list=None, tick=None): + if self._only_demo: + return + assert((action_info is not None and snapshot_list is not None) or tick is not None) + + if action_info is not None and snapshot_list is not None: + # update the state dict + static_code = action_info.port_idx + dynamic_code = action_info.vessel_idx + if self.last_tick == action_info.tick: + tick_range = [action_info.tick] + else: + tick_range = list(range(self.last_tick+1, action_info.tick+1, 1)) + + self.last_tick = action_info.tick + # print(static_code, dynamic_code) + self._sync_raw_features(snapshot_list, tick_range, static_code, dynamic_code) + tick = action_info.tick + + # state_tick_range is inverse order + state_tick_range = np.arange(tick, max(-1, tick-self._tick_buffer), -1) + # print(state_tick_range) + v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim('v'))) + v[:len(state_tick_range)] = self._state_dict['v'][state_tick_range] + p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim('p'))) + p[:len(state_tick_range)] = self._state_dict['p'][state_tick_range] + + # true means padding + mask = np.ones(self._tick_buffer, dtype=np.bool) + mask[:len(state_tick_range)] = False + ret = { + 'tick': state_tick_range, + 'v': v, + 'p': p, + 'vo': self._state_dict['vo'][tick], + 'po': self._state_dict['po'][tick], + 'vedge': self._state_dict['vedge'][tick], + 'pedge': self._state_dict['pedge'][tick], + 'ppedge': self._state_dict['ppedge'][tick], + 'mask': mask, + 'len': len(state_tick_range), + } + + return ret + + def normalize(self, feature): + if not self._normalize: + return feature + return feature*self._norm_scale + + def get_input_dim(self, agent_code): + if agent_code in self.port_code_inv_dict or agent_code == 'p': + return len(self.port_features) + (self.node_cnt if self._feature_config.onehot_identity else 0) + elif agent_code in self.vessel_code_inv_dict or agent_code == 'v': + return len(self.vessel_features) + (self.node_cnt if self._feature_config.onehot_identity else 0) + elif agent_code == 'vedge': + # v-p edge: (arrival_time, laden to destination) + return 2 + elif agent_code == 'pedge': + # p-p edge: (laden to destination, ) + return 1 + else: + raise ValueError('agent not exist!') diff --git a/examples/ecr/gnn/transformer.py b/examples/ecr/gnn/transformer.py new file mode 100644 index 000000000..06122f1a5 --- /dev/null +++ b/examples/ecr/gnn/transformer.py @@ -0,0 +1,342 @@ +import torch +import copy +import torch.nn as nn +import math +from torch.autograd import Variable +from torch.nn import functional as F + +# lib for transformer +from torch.nn.modules.module import Module +from torch.nn.modules.activation import MultiheadAttention +from torch.nn.modules.container import ModuleList +from torch.nn.init import xavier_uniform_ +from torch.nn.modules.dropout import Dropout +from torch.nn.modules.linear import Linear +from torch.nn.modules.normalization import LayerNorm +# import numpy as np +# from .transformer_source import TransformerEncoder, TransformerEncoderLayer + +class PositionalEncoder(nn.Module): + def __init__(self, d_model, max_seq_len = 80): + super().__init__() + self.d_model = d_model + self.times = 4*math.sqrt(self.d_model) + + # create constant 'pe' matrix with values dependant on + # pos and i + self.pe = torch.zeros(max_seq_len, d_model) + for pos in range(max_seq_len): + for i in range(0, d_model, 2): + self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i)/d_model))) + self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1))/d_model))) + + self.pe = self.pe.unsqueeze(1)/self.d_model + + def forward(self, x): + # make embeddings relatively larger + # x = x * self.sqrt_d_model + # add constant to embedding + # make the addon relatively smaller + addon = self.pe[:x.shape[0], :, :x.shape[2]].to(x.get_device()) + return x+addon + + +class TransGATLayer(nn.Module): + def __init__(self, src_dim, dest_dim, edge_dim, hidden_size, nhead=4, agreggate='first', position_encoding=True): + super().__init__() + self.src_dim = src_dim + self.dest_dim = dest_dim + self.edge_dim = edge_dim + self.hidden_size = hidden_size + self.nhead = nhead + self.concat_layers = [] + self.concat_layers.append(nn.Linear(src_dim+dest_dim+edge_dim, hidden_size)) + self.concat_layers.append(GeLU()) + self.enable_pe = position_encoding + if position_encoding: + self.pe = PositionalEncoder(d_model=hidden_size, max_seq_len=40) + self.pre_layer = nn.Sequential(*self.concat_layers) + + encoder_layer = TransformerEncoderLayer(d_model=hidden_size, nhead=nhead, activation='gelu', dim_feedforward=hidden_size*4) + self.encoder = TransformerEncoder(encoder_layer, num_layers=2) + self.aggregate_func = agreggate + + if self.aggregate_func == 'decoder': + decoder_fc = [nn.Linear(dest_dim, hidden_size), GeLU()] + self.decoder_fc = nn.Sequential(*decoder_fc) + decoder_layer = CustomTransformerDecoderLayer(d_model=hidden_size, nhead=nhead, activation='gelu', dim_feedforward=hidden_size*4) + self.decoder = TransformerDecoder(decoder_layer, num_layers=1) + # self.encoder = TransformerEncoder(encoder_layer, num_layers=2) + self.zero_padding_template = torch.zeros((1, src_dim), dtype=torch.float) + + def _aggregate(self, emb): + # emb.shape: (seq_len, cnt, dim) + if self.aggregate_func == 'first': + return emb[0] + elif self.aggregate_func == 'max_pooling': + return torch.max(emb, axis=0)[0] + elif self.aggregate_func == 'sum': + return torch.sum(emb, axis=0) + elif self.aggregate_func == 'mean': + return torch.mean(emb, axis=0) + + def forward(self, src, dest, adj, mask, edges=None): + ''' + src.shape: (batch, src_cnt, src_dim) + dest.shape: (batch, dest_cnt, dest_dim) + adj.shape (ordered): (src_cnt, batch*dest_cnt) + mask.shape : (batch*dest_cnt)*src_cnt + edges.shape: (batch*dest_cnt, src_cnt, edge_dim) + ''' + assert(self.src_dim == src.shape[-1]) + assert(self.dest_dim== dest.shape[-1]) + batch, s_cnt, src_dim = src.shape + batch, d_cnt, dest_dim = dest.shape + + src_embedding = src.reshape(-1, src.shape[-1]) + src_embedding = torch.cat((self.zero_padding_template.to(src_embedding.get_device()), src_embedding)) + + # adj = adj[:,torch.randperm(adj.size()[1])] + flat_adj = adj.reshape(-1) + # src_cnt * (batch * dest_cnt) * src_dim + dest_embedding = src_embedding[flat_adj].reshape(adj.shape[0], -1, src.shape[-1]) + + if self.aggregate_func != 'decoder': + if edges is not None: + pre_input = torch.cat((dest_embedding, edges), axis=2) + else: + dest_rep = dest.reshape(-1, dest.shape[-1]).unsqueeze(0).repeat(adj.shape[0], 1, 1) + # src_cnt * (batch * dest_cnt) * (src_dim + dest_dim + edge_dim*) + if edges is None: + pre_input = torch.cat((dest_embedding, dest_rep), axis=2) + else: + pre_input = torch.cat((dest_embedding, dest_rep, edges), axis=2) + + encoder_input = self.pre_layer(pre_input.reshape(-1, pre_input.shape[-1])).reshape(*pre_input.shape[:2], self.hidden_size) + if self.enable_pe: + encoder_input = self.pe(encoder_input) + + # src_cnt * (batch*dest_cnt) * hidden_size + dest_emb = self.encoder(encoder_input, src_key_padding_mask=mask) + + # only get the first dimension + if self.aggregate_func == 'decoder': + dest_decode = self.decoder_fc(dest.reshape(batch*d_cnt, dest_dim)) + aggregated_emb = self.decoder(dest_decode.reshape(1, batch*d_cnt, self.hidden_size), dest_emb, memory_key_padding_mask=mask) + else: + aggregated_emb = self._aggregate(dest_emb) + return aggregated_emb.reshape(batch, d_cnt, self.hidden_size) + + +class TransGAT(nn.Module): + def __init__(self, p_dim, v_dim, edge_dim:dict, output_size, layer_num=2): + super().__init__() + self.hidden_size = output_size + self.layer_num = layer_num + + pl, vl, ppl = [], [], [] + for i in range(layer_num): + if i==0: + pl.append(TransGATLayer(v_dim, p_dim, edge_dim['v'], self.hidden_size, nhead=4, agreggate='decoder')) + vl.append(TransGATLayer(p_dim, v_dim, edge_dim['v'], self.hidden_size, nhead=4, agreggate='decoder')) + # p2p links + ppl.append(TransGATLayer(p_dim, p_dim, edge_dim['p'], self.hidden_size, nhead=4, agreggate='decoder', position_encoding=False)) + else: + pl.append(TransGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, agreggate='decoder')) + if i != layer_num - 1: + # p2v conv is not necessary at the last layer, for we only use port features + vl.append(TransGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, agreggate='decoder')) + ppl.append(TransGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, agreggate='decoder', position_encoding=False)) + self.p_layers = nn.ModuleList(pl) + self.v_layers = nn.ModuleList(vl) + self.pp_layers = nn.ModuleList(ppl) + + def forward(self, p, pe, v, ve, ppe): + # p.shape: (batch*p_cnt, p_dim) + pp = p + pre_p, pre_v, pre_pp = p, v, pp + for i in range(self.layer_num): + # only feed edge info in the first layer + p = self.p_layers[i](pre_v, pre_p, adj=pe['adj'], edges=pe['edge'] if i==0 else None, mask=pe['mask']) + if i != self.layer_num - 1: + v = self.v_layers[i](pre_p, pre_v, adj=ve['adj'], edges=ve['edge'] if i==0 else None, mask=ve['mask']) + pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe['adj'], edges=ppe['edge'] if i==0 else None, mask=ppe['mask']) + pre_p, pre_v, pre_pp = p, v, pp + p = torch.cat((p, pp), axis=2) + return p, v + +class GeLU(nn.Module): + def __init__(self): + super().__init__() + + def forward(self, input): + return F.gelu(input) + +class Norm(nn.Module): + def __init__(self, d_model, eps = 1e-6): + super().__init__() + + self.size = d_model + # create two learnable parameters to calibrate normalisation + self.alpha = nn.Parameter(torch.ones(self.size)) + self.bias = nn.Parameter(torch.zeros(self.size)) + self.eps = eps + + def forward(self, x): + norm = self.alpha * (x - x.mean(dim=-1, keepdim=True)) / (x.std(dim=-1, keepdim=True) + self.eps) + self.bias + return norm + +class TransformerEncoder(Module): + def __init__(self, encoder_layer, num_layers, norm=None): + super(TransformerEncoder, self).__init__() + self.layers = _get_clones(encoder_layer, num_layers) + self.num_layers = num_layers + self.norm = norm + + def forward(self, src, mask=None, src_key_padding_mask=None): + output = src + + for i in range(self.num_layers): + output = self.layers[i](output, src_mask=mask, + src_key_padding_mask=src_key_padding_mask) + + if self.norm: + output = self.norm(output) + + return output + +class TransformerDecoder(Module): + def __init__(self, decoder_layer, num_layers, norm=None): + super(TransformerDecoder, self).__init__() + self.layers = _get_clones(decoder_layer, num_layers) + self.num_layers = num_layers + self.norm = norm + + def forward(self, tgt, memory, tgt_mask=None, + memory_mask=None, tgt_key_padding_mask=None, + memory_key_padding_mask=None): + output = tgt + + for i in range(self.num_layers): + output = self.layers[i](output, memory, tgt_mask=tgt_mask, + memory_mask=memory_mask, + tgt_key_padding_mask=tgt_key_padding_mask, + memory_key_padding_mask=memory_key_padding_mask) + + if self.norm: + output = self.norm(output) + + return output + +class TransformerEncoderLayer(Module): + def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"): + super(TransformerEncoderLayer, self).__init__() + self.self_attn = MultiheadAttention(d_model, nhead, dropout=dropout) + # Implementation of Feedforward model + self.linear1 = Linear(d_model, dim_feedforward) + self.dropout = Dropout(dropout) + self.linear2 = Linear(dim_feedforward, d_model) + + self.norm1 = LayerNorm(d_model) + self.norm2 = LayerNorm(d_model) + self.dropout1 = Dropout(dropout) + self.dropout2 = Dropout(dropout) + + self.activation = _get_activation_fn(activation) + + def forward(self, src, src_mask=None, src_key_padding_mask=None): + src2, att = self.self_attn(src, src, src, attn_mask=src_mask, + key_padding_mask=src_key_padding_mask) + # np.save('./visualization/multi_attention.npy', att.cpu().detach().numpy()) + src = src + self.dropout1(src2) + src = self.norm1(src) + if hasattr(self, "activation"): + src2 = self.linear2(self.dropout(self.activation(self.linear1(src)))) + else: # for backward compatibility + src2 = self.linear2(self.dropout(F.relu(self.linear1(src)))) + src = src + self.dropout2(src2) + src = self.norm2(src) + return src + + +class CustomTransformerDecoderLayer(Module): + r"""TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. + This standard decoder layer is based on the paper "Attention Is All You Need". + Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, + Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in + Neural Information Processing Systems, pages 6000-6010. Users may modify or implement + in a different way during application. + + Args: + d_model: the number of expected features in the input (required). + nhead: the number of heads in the multiheadattention models (required). + dim_feedforward: the dimension of the feedforward network model (default=2048). + dropout: the dropout value (default=0.1). + activation: the activation function of intermediate layer, relu or gelu (default=relu). + + Examples:: + >>> decoder_layer = nn.TransformerDecoderLayer(d_model=512, nhead=8) + >>> memory = torch.rand(10, 32, 512) + >>> tgt = torch.rand(20, 32, 512) + >>> out = decoder_layer(tgt, memory) + """ + + def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"): + super(CustomTransformerDecoderLayer, self).__init__() + # self.self_attn = MultiheadAttention(d_model, nhead, dropout=dropout) + self.multihead_attn = MultiheadAttention(d_model, nhead, dropout=dropout) + # Implementation of Feedforward model + self.linear1 = Linear(d_model, dim_feedforward) + self.dropout = Dropout(dropout) + self.linear2 = Linear(dim_feedforward, d_model) + + # self.norm1 = LayerNorm(d_model) + self.norm2 = LayerNorm(d_model) + self.norm3 = LayerNorm(d_model) + # self.dropout1 = Dropout(dropout) + self.dropout2 = Dropout(dropout) + self.dropout3 = Dropout(dropout) + + self.activation = _get_activation_fn(activation) + + def forward(self, tgt, memory, tgt_mask=None, memory_mask=None, + tgt_key_padding_mask=None, memory_key_padding_mask=None): + r"""Pass the inputs (and mask) through the decoder layer. + + Args: + tgt: the sequence to the decoder layer (required). + memory: the sequnce from the last layer of the encoder (required). + tgt_mask: the mask for the tgt sequence (optional). + memory_mask: the mask for the memory sequence (optional). + tgt_key_padding_mask: the mask for the tgt keys per batch (optional). + memory_key_padding_mask: the mask for the memory keys per batch (optional). + + Shape: + see the docs in Transformer class. + """ + # tgt2 = self.self_attn(tgt, tgt, tgt, attn_mask=tgt_mask, + # key_padding_mask=tgt_key_padding_mask)[0] + # tgt = tgt + self.dropout1(tgt2) + # tgt = self.norm1(tgt) + tgt2 = self.multihead_attn(tgt, memory, memory, attn_mask=memory_mask, + key_padding_mask=memory_key_padding_mask)[0] + tgt = tgt + self.dropout2(tgt2) + tgt = self.norm2(tgt) + if hasattr(self, "activation"): + tgt2 = self.linear2(self.dropout(self.activation(self.linear1(tgt)))) + else: # for backward compatibility + tgt2 = self.linear2(self.dropout(F.relu(self.linear1(tgt)))) + tgt = tgt + self.dropout3(tgt2) + tgt = self.norm3(tgt) + return tgt + +def _get_clones(module, N): + return ModuleList([copy.deepcopy(module) for i in range(N)]) + +def _get_activation_fn(activation): + if activation == "relu": + return F.relu + elif activation == "gelu": + return F.gelu + else: + raise RuntimeError("activation should be relu/gelu, not %s." % activation) \ No newline at end of file diff --git a/examples/ecr/gnn/utils.py b/examples/ecr/gnn/utils.py new file mode 100644 index 000000000..7179777c4 --- /dev/null +++ b/examples/ecr/gnn/utils.py @@ -0,0 +1,358 @@ +import numpy as np +import torch, sys, argparse +import json +import ast, math +from collections import defaultdict, OrderedDict +from maro.simulator.scenarios.ecr.common import Action, DecisionEvent +from maro.simulator import Env +import shutil +from maro.utils import convert_dottable, clone +import io, yaml, os, shutil +import datetime +from torch.optim.lr_scheduler import LambdaLR +from torch.optim import SGD +import random + +def compute_v2p_degree_matrix(env): + ''' + this function compute the adjacent matrix + ''' + topo_config = env.configs + static_dict = env.summary['node_mapping']['ports'] + dynamic_dict = env.summary['node_mapping']['vessels'] + adj_matrix = np.zeros((len(dynamic_dict), len(static_dict)), dtype=np.int) + for v, vinfo in topo_config['vessels'].items(): + route_name = vinfo['route']['route_name'] + route = topo_config['routes'][route_name] + vid = dynamic_dict[v] + for p in route: + adj_matrix[vid][static_dict[p['port_name']]] += 1 + + return adj_matrix + +def warm_up_lr(opt, warmup_steps): + warm_up = lambda ep: math.pow(warmup_steps, 0.5) * min(math.pow(ep+1, -0.5), math.pow(warmup_steps, -1.5)*(ep+1)) + return LambdaLR(opt, warm_up) + +def from_numpy(device, *np_values): + return [torch.from_numpy(v).to(device) for v in np_values] + +def differ_gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): + ''' + v: (seq_len, batch, v_cnt, v_dim) + vo: (batch, v_cnt, p_cnt) + vedge: (batch, v_cnt, p_cnt, e_dim) + ''' + + seq_len, batch, v_cnt, v_dim = v.shape + _, _, p_cnt, p_dim = p.shape + + p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask = from_numpy(device, p, po, pedge, + v, vo, vedge, p2p, ppedge, seq_mask) + + batch_range = torch.arange(batch, dtype=torch.long).to(device) + # vadj.shape: (batch*v_cnt, p_cnt*) + vadj, vedge = flatten_embedding(vo, batch_range, vedge) + # vmask.shape: (batch*v_cnt, p_cnt*) + vmask = vadj == 0 + # vadj.shape: (p_cnt*, batch*v_cnt) + vadj = vadj.transpose(0, 1) + # vedge.shape: (p_cnt*, batch*v_cnt, e_dim) + vedge = vedge.transpose(0, 1) + # vedge = vedge.reshape(-1, *vedge.shape[-2:]).transpose(0, 1)[:vadj.shape[0]] + + padj, pedge = flatten_embedding(po, batch_range, pedge) + pmask = padj == 0 + padj = padj.transpose(0, 1) + pedge = pedge.transpose(0, 1) + # pedge = pedge.reshape(-1, *pedge.shape[-2:]).transpose(0, 1)[:padj.shape[0]] + + p2p_adj = p2p.repeat(batch, 1, 1) + # p2p_adj.shape: (batch*p_cnt, p_cnt*) + p2p_adj, ppedge = flatten_embedding(p2p_adj, batch_range, ppedge) + # p2p_mask.shape: (batch*p_cnt, p_cnt*) + p2p_mask = p2p_adj == 0 + # p2p_adj.shape: (p_cnt*, batch*p_cnt) + p2p_adj = p2p_adj.transpose(0, 1) + ppedge = ppedge.transpose(0, 1) + + return { + 'v': v, + 'p': p, + 'pe': { + 'edge': pedge, + 'adj': padj, + 'mask': pmask, + }, + 've': { + 'edge': vedge, + 'adj': vadj, + 'mask': vmask, + }, + 'ppe': { + 'edge': ppedge, + 'adj': p2p_adj, + 'mask': p2p_mask, + }, + 'mask': seq_mask, + } + +def lstm_graph_union(v, p, vo, po, device, v2v=None, p2p=None): + batch, seq_len, v_cnt, v_dim = v.shape + _, _, p_cnt, p_dim = p.shape + + v = torch.from_numpy(v).to(device) + p = torch.from_numpy(p).to(device) + vo = torch.from_numpy(vo).to(device) + po = torch.from_numpy(po).to(device) + + v = v.transpose(0, 1) + p = p.transpose(0, 1) + vo = vo.transpose(0, 1) + po = po.transpose(0, 1) + + batch_range = torch.arange(batch*seq_len, dtype=torch.long).to(device) + vo = flatten_embedding(vo, batch_range) + po = flatten_embedding(po, batch_range) + + v = v.reshape(seq_len*batch*v_cnt, v_dim) + p = p.reshape(seq_len*batch*p_cnt, p_dim) + + ret = {'v': v, 'p': p, 'vo': vo, 'po': po} + + if v2v is not None: + v2v = torch.from_numpy(v2v).to(device).repeat(seq_len, batch, 1, 1) + v2v = flatten_embedding(v2v, batch_range) + ret['v2v'] = v2v + if p2p is not None: + p2p = torch.from_numpy(p2p).to(device).repeat(seq_len, batch, 1, 1) + p2p = flatten_embedding(p2p, batch_range) + ret['p2p'] = p2p + return ret + +def order_union(v, p, vo, po, device, v2v=None, p2p=None): + # batch = v.shape[0] + batch, v_cnt, seq_len, v_dim = v.shape + _, p_cnt, _, p_dim = p.shape + + v = torch.from_numpy(v).to(device) + p = torch.from_numpy(p).to(device) + vo = torch.from_numpy(vo).to(device) + po = torch.from_numpy(po).to(device) + + v = v.reshape(batch *v_cnt, seq_len, v_dim) + p = p.reshape(batch *p_cnt, seq_len, p_dim) + + batch_range = torch.arange(batch, dtype=torch.long).to(device) + vo = flatten_embedding(vo, batch_range) + po = flatten_embedding(po, batch_range) + + ret = {'v': v, 'p': p, 'vo': vo, 'po': po} + + if v2v is not None: + v2v = torch.from_numpy(v2v).to(device).repeat(batch, 1, 1) + v2v = flatten_embedding(v2v, batch_range) + ret['v2v'] = v2v + if p2p is not None: + p2p = torch.from_numpy(p2p).to(device).repeat(batch, 1, 1) + p2p = flatten_embedding(p2p, batch_range) + ret['p2p'] = p2p + + return ret + +def base_union(v, device): + # batch = v.shape[0] + batch, seq_len, v_dim = v.shape + v = v.reshape(batch, seq_len, v_dim) + # v = np.transpose(v,(1,0,2)) + v = torch.from_numpy(v).to(device) + + + return v + +def flatten_embedding(embedding, batch_range, edge=None): + if len(embedding.shape) == 3: + batch, x_cnt, y_cnt = embedding.shape + addon = (batch_range*y_cnt).view(batch, 1, 1) + else: + seq_len, batch, x_cnt, y_cnt = embedding.shape + addon = (batch_range*y_cnt).view(seq_len, batch, 1, 1) + + embedding_mask = embedding == 0 + embedding += addon + embedding[embedding_mask] = 0 + ret = embedding.reshape(-1, embedding.shape[-1]) + col_mask = ret.sum(dim=0) != 0 + ret = ret[:, col_mask] + if edge is None: + return ret + else: + edge = edge.reshape(-1, *edge.shape[2:])[:, col_mask, :] + return ret, edge + +def log2json(file_path): + with open(file_path, 'r') as fp: + lines = fp.read().splitlines() + json_list = '[' + ','.join(lines) + ']' + return ast.literal_eval(json_list) + +def decision_cnt_analysis(env, pv=False, buffer_size=8): + if not pv: + decision_cnt = [buffer_size] * len(env.node_name_mapping['static']) + r, pa, is_done = env.step(None) + while not is_done: + decision_cnt[pa.port_idx] += 1 + action = Action(pa.vessel_idx, pa.port_idx, 0) + r, pa, is_done = env.step(action) + else: + decision_cnt = OrderedDict() + r, pa, is_done = env.step(None) + while not is_done: + if (pa.port_idx, pa.vessel_idx) not in decision_cnt: + decision_cnt[pa.port_idx, pa.vessel_idx] = buffer_size + else: + decision_cnt[pa.port_idx, pa.vessel_idx] += 1 + action = Action(pa.vessel_idx, pa.port_idx, 0) + r, pa, is_done = env.step(action) + env.reset() + return decision_cnt + +def random_shortage(env, tick, action_dim=21): + zero_idx = action_dim//2 + r, pa, is_done = env.step(None) + node_cnt = len(env.summary['node_mapping']['ports']) + while not is_done: + ''' + load, discharge = pa.action_scope.load, pa.action_scope.discharge + action_idx = np.random.randint(action_dim) - zero_idx + if action_idx < 0: + actual_action = int(1.0*action_idx/zero_idx*load) + else: + actual_action = int(1.0*action_idx/zero_idx*discharge) + ''' + # print(action_idx, -load, actual_action, discharge) + action = Action(pa.vessel_idx, pa.port_idx, 0) + r, pa, is_done = env.step(action) + + shs = env.snapshot_list['ports'][tick-1:list(range(node_cnt)):'acc_shortage'] + fus = env.snapshot_list['ports'][tick-1:list(range(node_cnt)):'acc_fulfillment'] + env.reset() + return fus - shs, np.sum(shs+fus) + +def return_scaler(env, tick, gamma, action_dim=21): + R, tot_amount = random_shortage(env, tick, action_dim) + Rs_mean = np.mean(R)/tick/(1-gamma) + return abs(1.0/Rs_mean), tot_amount + + +def load_config(config_pth): + with io.open(config_pth, 'r') as in_file: + raw_config = yaml.safe_load(in_file) + config = convert_dottable(raw_config) + + if config.env.seed < 0: + config.env.seed = random.randint(0, 99999) + + regularize_config(config) + return config + +def save_config(config, config_pth): + with open(config_pth, 'w') as fp: + config = dottable2dict(config) + config['env']['exp_per_ep'] = ['%d, %d, %d'%(k[0], k[1],d) for k, d in config['env']['exp_per_ep'].items()] + yaml.safe_dump(config, fp) + +def dottable2dict(config): + if isinstance(config, float): + return str(config) + if not isinstance(config, dict): + return clone(config) + rt = {} + for k, v in config.items(): + rt[k] = dottable2dict(v) + return rt + +def save_code(folder, save_pth): + save_path = os.path.join(save_pth,'code') + code_pth = os.path.join(os.getcwd(),folder) + shutil.copytree(code_pth,save_path) + + +def fix_seed(env, seed): + env.set_seed(seed) + np.random.seed(seed) + random.seed(seed) + +def zero_play(**args): + env = Env(**args) + static_mapping = env.node_name_mapping['static'] + r, pa, is_done = env.step(None) + while not is_done: + action = Action(pa.vessel_idx, pa.port_idx, 0) + r, pa, is_done = env.step(action) + return env.snapshot_list + + +def regularize_config(config): + def parse_value(v): + try: + return int(v) + except: + try: + return float(v) + except: + if v == 'false' or v == 'False': + return False + elif v == 'true' or v == 'True': + return True + else: + return v + + def set_attr(config, attrs, value): + if len(attrs) == 1: + config[attrs[0]] = value + else: + set_attr(config[attrs[0]], attrs[1:], value) + + all_args = sys.argv[1:] + for i in range(len(all_args)//2): + name = all_args[i*2] + attrs = name[2:].split('.') + value = parse_value(all_args[i*2+1]) + set_attr(config, attrs, value) + +def analysis_speed(env): + speed_dict = defaultdict(int) + eq_speed = 0 + for ves in env.configs['vessels'].values(): + speed_dict[ves['sailing']['speed']] += 1 + for sp, cnt in speed_dict.items(): + eq_speed += 1.0*cnt/sp + eq_speed = 1.0/eq_speed + return speed_dict, eq_speed + + +if __name__ == "__main__": + for i in range(5): + + snapshot_list6 = zero_play(max_tick=500, scenario='ecr', topology='22p_global_l0.0') + sh6 = snapshot_list6.static_nodes[499:list(range(22)):('acc_shortage', 0)] + print(sh6) + print(sum(sh6)) + + snapshot_list7 = zero_play(max_tick=500, scenario='ecr', topology='22p_global_l0.0') + sh7 = snapshot_list7.static_nodes[499:list(range(22)):('acc_shortage', 0)] + print(sh7) + print(sum(sh7)) + + env6 = Env(max_tick=500, scenario='ecr', topology='22p_global_l0.0') + spd6, eq6 = analysis_speed(env6) + dd6 = decision_cnt_analysis(env6) + print(spd6) + print(dd6) + + env7 = Env(max_tick=500, scenario='ecr', topology='22p_global_l0.0') + spd7, eq7 = analysis_speed(env7) + dd7 = decision_cnt_analysis(env7) + print(spd7) + print(dd7) \ No newline at end of file From 3370f12e87f4f2f3844f1effb0b4db84ff47d72a Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Wed, 23 Sep 2020 09:59:45 +0800 Subject: [PATCH 02/25] fix import path error and remove useless function --- examples/ecr/gnn/actor.py | 11 +- examples/ecr/gnn/actor_critic.py | 6 +- examples/ecr/gnn/agent.py | 2 +- examples/ecr/gnn/agent_manager.py | 1 - examples/ecr/gnn/config.yml | 4 +- examples/ecr/gnn/differ_gnn_model.py | 131 ---------- examples/ecr/gnn/launcher.py | 2 +- examples/ecr/gnn/learner.py | 4 +- examples/ecr/gnn/transformer.py | 342 --------------------------- examples/ecr/gnn/utils.py | 103 +------- 10 files changed, 17 insertions(+), 589 deletions(-) delete mode 100644 examples/ecr/gnn/differ_gnn_model.py delete mode 100644 examples/ecr/gnn/transformer.py diff --git a/examples/ecr/gnn/actor.py b/examples/ecr/gnn/actor.py index da17bf159..6f4e325c8 100644 --- a/examples/ecr/gnn/actor.py +++ b/examples/ecr/gnn/actor.py @@ -11,9 +11,8 @@ from maro.rl import AbsActor from examples.ecr.gnn.numpy_store import NumpyStore, Shuffler from examples.ecr.gnn.action_shaper import DiscreteActionShaper -from examples.ecr.gnn.utils import fix_seed, differ_gnn_union +from examples.ecr.gnn.utils import fix_seed, gnn_union from examples.ecr.gnn.experience_shaper import ExperienceShaper -from examples.ecr.gnn.differ_gnn_model import SharedAC from examples.ecr.gnn.state_shaper import GNNStateShaper from collections import defaultdict, OrderedDict from examples.ecr.gnn.actor_critic import ActorCritic @@ -319,7 +318,7 @@ def roll_out(self): step_i += 1 t = time.time() - graph = differ_gnn_union(self.action_io_np['p'], self.action_io_np['po'], self.action_io_np['pedge'], + graph = gnn_union(self.action_io_np['p'], self.action_io_np['po'], self.action_io_np['pedge'], self.action_io_np['v'], self.action_io_np['vo'], self.action_io_np['vedge'], self._gnn_state_shaper.p2p_static_graph, self.action_io_np['ppedge'], self.action_io_np['mask'], self.device) t_state += time.time() - t @@ -345,7 +344,7 @@ def roll_out(self): self._trainsfer_time += time.time() - tick - self.logger.debug(dict(zip(self.log_header, self.action_io_np['sh']))) + self._logger.debug(dict(zip(self.log_header, self.action_io_np['sh']))) # print(loged_dict) with open(os.path.join(self.config.log.path, 'logs_%d'%self._roll_out_cnt), 'wb') as fp: @@ -359,8 +358,8 @@ def roll_out(self): with open(os.path.join(self.config.log.path, 'exp_%d'%self._roll_out_cnt), 'wb') as fp: pickle.dump(result, fp) - self._logger.debug('play time: %d' % int(self._actor._roll_out_time)) - self._logger.debug('transfer time: %d' % int(self._actor._trainsfer_time)) + self._logger.debug('play time: %d' % int(self._roll_out_time)) + self._logger.debug('transfer time: %d' % int(self._trainsfer_time)) return result def exit(self): diff --git a/examples/ecr/gnn/actor_critic.py b/examples/ecr/gnn/actor_critic.py index 4d138cb4b..0a83ab221 100644 --- a/examples/ecr/gnn/actor_critic.py +++ b/examples/ecr/gnn/actor_critic.py @@ -8,7 +8,7 @@ from maro.rl import AbsAlgorithm -from examples.ecr.gnn.utils import differ_gnn_union +from examples.ecr.gnn.utils import gnn_union class ActorCritic(AbsAlgorithm): def __init__(self, model: nn.Module, @@ -105,12 +105,12 @@ def train(self, batch, p_idx, v_idx): return_batch = batch['R'] next_obs_batch = batch['s_'] - obs_batch = differ_gnn_union(obs_batch['p'], obs_batch['po'], obs_batch['pedge'], obs_batch['v'], + obs_batch = gnn_union(obs_batch['p'], obs_batch['po'], obs_batch['pedge'], obs_batch['v'], obs_batch['vo'], obs_batch['vedge'], self._p2p_adj, obs_batch['ppedge'], obs_batch['mask'], self._device) action_batch = torch.from_numpy(action_batch).long().to(self._device) return_batch = torch.from_numpy(return_batch).float().to(self._device) - next_obs_batch = differ_gnn_union(next_obs_batch['p'], next_obs_batch['po'], next_obs_batch['pedge'], + next_obs_batch = gnn_union(next_obs_batch['p'], next_obs_batch['po'], next_obs_batch['pedge'], next_obs_batch['v'], next_obs_batch['vo'], next_obs_batch['vedge'], self._p2p_adj, next_obs_batch['ppedge'], next_obs_batch['mask'], self._device) diff --git a/examples/ecr/gnn/agent.py b/examples/ecr/gnn/agent.py index 27dd5b376..9961a82c3 100644 --- a/examples/ecr/gnn/agent.py +++ b/examples/ecr/gnn/agent.py @@ -19,7 +19,7 @@ def train(self, training_config): while shuffler.has_next(): batch = shuffler.next() actor_loss, critic_loss, entropy_loss, tot_loss = self._algorithm.train(batch, self._name[0], - self._name[1], entropy= training_config.entropy_loss_enable) + self._name[1]) loss_dict['actor'].append(actor_loss) loss_dict['critic'].append(critic_loss) loss_dict['entropy'].append(entropy_loss) diff --git a/examples/ecr/gnn/agent_manager.py b/examples/ecr/gnn/agent_manager.py index 8927d1532..489205b68 100644 --- a/examples/ecr/gnn/agent_manager.py +++ b/examples/ecr/gnn/agent_manager.py @@ -77,7 +77,6 @@ def load_models_from_files(self, model_pth): self._algorithm.load_model(model_pth) def train(self, training_config): - for agent in self._agent_dict.values(): agent.train(training_config) diff --git a/examples/ecr/gnn/config.yml b/examples/ecr/gnn/config.yml index 354eeea7e..525aed707 100644 --- a/examples/ecr/gnn/config.yml +++ b/examples/ecr/gnn/config.yml @@ -7,9 +7,9 @@ env: # topology: "toy.4p_ssdd_l0.0" training: enable: True - parallel_cnt: 2 + parallel_cnt: 24 device: 'cuda:1' - batch_size: 150 + batch_size: 1024 shuffle_time: 1 rollout_cnt: 1000 train_freq: 1 diff --git a/examples/ecr/gnn/differ_gnn_model.py b/examples/ecr/gnn/differ_gnn_model.py deleted file mode 100644 index 4601fe442..000000000 --- a/examples/ecr/gnn/differ_gnn_model.py +++ /dev/null @@ -1,131 +0,0 @@ -import torch -import torch.nn as nn -import torch.nn.functional as F -from .transformer import TransGAT, PositionalEncoder, GeLU, Norm -from torch.nn import TransformerEncoder, TransformerEncoderLayer -from torch.nn.modules.dropout import Dropout -# import numpy as np -# import datetime -class Header(nn.Module): - def __init__(self, input_size, hidden_size, output_size, net_type='res'): - super().__init__() - self.net_type = net_type - if net_type == 'res': - self.fc_0 = nn.Linear(input_size, hidden_size) - self.act_0 = GeLU() - # self.do_0 = Dropout(dropout) - self.fc_1 = nn.Linear(hidden_size, input_size) - self.act_1 = GeLU() - self.fc_2 = nn.Linear(input_size, output_size) - elif net_type == '2layer': - self.fc_0 = nn.Linear(input_size, hidden_size) - self.act_0 = GeLU() - # self.do_0 = Dropout(dropout) - self.fc_1 = nn.Linear(hidden_size, hidden_size//2) - self.act_1 = GeLU() - self.fc_2 = nn.Linear(hidden_size//2, output_size) - elif net_type == '1layer': - self.fc_0 = nn.Linear(input_size, hidden_size) - self.act_0 = GeLU() - self.fc_1 = nn.Linear(hidden_size, output_size) - - - def forward(self, x): - if self.net_type == 'res': - x1 = self.act_0(self.fc_0(x)) - x1 = self.act_1(self.fc_1(x1) + x) - return self.fc_2(x1) - elif self.net_type == '2layer': - x = self.act_0(self.fc_0(x)) - x = self.act_1(self.fc_1(x)) - x = self.fc_1(x) - return x - else: - x = self.fc_1(self.act_0(self.fc_0(x))) - return x - - -class SharedAC(nn.Module): - def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head='res'): - super().__init__() - assert(a or c) - self.a, self.c = a, c - self.input_dim_v = input_dim_v - self.input_dim_p = input_dim_p - self.tick_buffer = tick_buffer - - self.pre_dim_v, self.pre_dim_p = 8*scale, 16*scale - self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) - self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) - p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation='gelu', dim_feedforward=self.pre_dim_p*4) - v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation='gelu', dim_feedforward=self.pre_dim_v*4) - # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) - # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) - self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) - self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3) - - self.gnn_output_size = 32*scale - self.trans_gat = TransGAT( - p_dim=self.pre_dim_p, - v_dim=self.pre_dim_v, - output_size=self.gnn_output_size//2, - edge_dim={'p': edge_dim_p, 'v': edge_dim_v}, - layer_num=2 - ) - - # self.reduce_dim = nn.Linear(self.a_input, 2) - - if a: - self.policy_hidden_size = 16*scale - self.a_input = 3*self.gnn_output_size//2 - self.actor = nn.Sequential(Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), nn.Softmax(dim=-1)) - if c: - self.value_hidden_size = 16*scale - self.c_input = self.gnn_output_size - self.critic = Header(self.c_input, self.value_hidden_size, 1, ac_head) - - - def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): - assert((a and p_idx is not None and v_idx is not None) or c) - feature_p, feature_v = state['p'], state['v'] - - tb, bsize, p_cnt, _ = feature_p.shape - v_cnt = feature_v.shape[2] - assert(tb == self.tick_buffer) - - # before: feature_p.shape: (tick_buffer, batch_size, p_cnt, p_dim) - # after: feature_p.shape: (tick_buffer, batch_size*p_cnt, p_dim) - feature_p = self.p_pre_layer(feature_p.reshape(feature_p.shape[0], -1, feature_p.shape[-1])) - # state['mask']: (batch_size, tick_buffer) - # mask_p: (batch_size, p_cnt, tick_buffer) - mask_p = state['mask'].repeat(1, p_cnt).reshape(-1, self.tick_buffer) - feature_p = self.trans_layer_p(feature_p, src_key_padding_mask=mask_p) - - feature_v = self.v_pre_layer(feature_v.reshape(feature_v.shape[0], -1, feature_v.shape[-1])) - mask_v = state['mask'].repeat(1, v_cnt).reshape(-1, self.tick_buffer) - feature_v = self.trans_layer_v(feature_v, src_key_padding_mask=mask_v) - - feature_p = feature_p[0].reshape(bsize, p_cnt, self.pre_dim_p) - feature_v = feature_v[0].reshape(bsize, v_cnt, self.pre_dim_v) - - emb_p, emb_v = self.trans_gat(feature_p, state['pe'], feature_v, state['ve'], state['ppe']) - - # date_str = f"{datetime.datetime.now().strftime('%Y%m%d')}" - # time_str = f"{datetime.datetime.now().strftime('%H%M%S.%f')}" - # subfolder_name = '%s_%s'%('./visualization/graph_embedding_p.npy', time_str) - # np.save('%s_%s.npy'%('./visualization/emb/p_emb/emb', time_str), emb_p.cpu().detach().numpy()) - # np.save('%s_%s.npy'%('./visualization/emb/v_emb/emb', time_str), emb_v.cpu().detach().numpy()) - - a_rtn, c_rtn = None, None - if a and self.a: - ap = emb_p.reshape(bsize, p_cnt, self.gnn_output_size) - ap = ap[:, p_idx, :] - av = emb_v.reshape(bsize, v_cnt, self.gnn_output_size//2) - av = av[:, v_idx, :] - emb_a = torch.cat((ap, av), axis=1) - a_rtn = self.actor(emb_a) - if c and self.c: - c_rtn = self.critic(emb_p).reshape(bsize, p_cnt) - return a_rtn, c_rtn - - \ No newline at end of file diff --git a/examples/ecr/gnn/launcher.py b/examples/ecr/gnn/launcher.py index e1bb3a3c9..6911c3306 100644 --- a/examples/ecr/gnn/launcher.py +++ b/examples/ecr/gnn/launcher.py @@ -17,7 +17,7 @@ if __name__ == "__main__": - config_pth = 'examples/ecr/gnn/config_22p.yml' + config_pth = 'examples/ecr/gnn/config.yml' config = load_config(config_pth) # generate log path. diff --git a/examples/ecr/gnn/learner.py b/examples/ecr/gnn/learner.py index 8ae7b4eb8..71cc2b6c4 100644 --- a/examples/ecr/gnn/learner.py +++ b/examples/ecr/gnn/learner.py @@ -38,13 +38,11 @@ def train(self, training_config, log_pth=None): loss_dict = self._trainable_agents.train(training_config) training_time += time.time() - tick - self._logger.info() - if log_pth is not None and (i+1) % training_config.model_save_freq == 0: self._actor.save_model(os.path.join(log_pth, 'models'), i+1) - self._logger.debug('tot rollout_time: %d' % int(rollout_time)) + self._logger.debug('total rollout_time: %d' % int(rollout_time)) self._logger.debug('train_time: %d' % int(training_time)) diff --git a/examples/ecr/gnn/transformer.py b/examples/ecr/gnn/transformer.py deleted file mode 100644 index 06122f1a5..000000000 --- a/examples/ecr/gnn/transformer.py +++ /dev/null @@ -1,342 +0,0 @@ -import torch -import copy -import torch.nn as nn -import math -from torch.autograd import Variable -from torch.nn import functional as F - -# lib for transformer -from torch.nn.modules.module import Module -from torch.nn.modules.activation import MultiheadAttention -from torch.nn.modules.container import ModuleList -from torch.nn.init import xavier_uniform_ -from torch.nn.modules.dropout import Dropout -from torch.nn.modules.linear import Linear -from torch.nn.modules.normalization import LayerNorm -# import numpy as np -# from .transformer_source import TransformerEncoder, TransformerEncoderLayer - -class PositionalEncoder(nn.Module): - def __init__(self, d_model, max_seq_len = 80): - super().__init__() - self.d_model = d_model - self.times = 4*math.sqrt(self.d_model) - - # create constant 'pe' matrix with values dependant on - # pos and i - self.pe = torch.zeros(max_seq_len, d_model) - for pos in range(max_seq_len): - for i in range(0, d_model, 2): - self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i)/d_model))) - self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1))/d_model))) - - self.pe = self.pe.unsqueeze(1)/self.d_model - - def forward(self, x): - # make embeddings relatively larger - # x = x * self.sqrt_d_model - # add constant to embedding - # make the addon relatively smaller - addon = self.pe[:x.shape[0], :, :x.shape[2]].to(x.get_device()) - return x+addon - - -class TransGATLayer(nn.Module): - def __init__(self, src_dim, dest_dim, edge_dim, hidden_size, nhead=4, agreggate='first', position_encoding=True): - super().__init__() - self.src_dim = src_dim - self.dest_dim = dest_dim - self.edge_dim = edge_dim - self.hidden_size = hidden_size - self.nhead = nhead - self.concat_layers = [] - self.concat_layers.append(nn.Linear(src_dim+dest_dim+edge_dim, hidden_size)) - self.concat_layers.append(GeLU()) - self.enable_pe = position_encoding - if position_encoding: - self.pe = PositionalEncoder(d_model=hidden_size, max_seq_len=40) - self.pre_layer = nn.Sequential(*self.concat_layers) - - encoder_layer = TransformerEncoderLayer(d_model=hidden_size, nhead=nhead, activation='gelu', dim_feedforward=hidden_size*4) - self.encoder = TransformerEncoder(encoder_layer, num_layers=2) - self.aggregate_func = agreggate - - if self.aggregate_func == 'decoder': - decoder_fc = [nn.Linear(dest_dim, hidden_size), GeLU()] - self.decoder_fc = nn.Sequential(*decoder_fc) - decoder_layer = CustomTransformerDecoderLayer(d_model=hidden_size, nhead=nhead, activation='gelu', dim_feedforward=hidden_size*4) - self.decoder = TransformerDecoder(decoder_layer, num_layers=1) - # self.encoder = TransformerEncoder(encoder_layer, num_layers=2) - self.zero_padding_template = torch.zeros((1, src_dim), dtype=torch.float) - - def _aggregate(self, emb): - # emb.shape: (seq_len, cnt, dim) - if self.aggregate_func == 'first': - return emb[0] - elif self.aggregate_func == 'max_pooling': - return torch.max(emb, axis=0)[0] - elif self.aggregate_func == 'sum': - return torch.sum(emb, axis=0) - elif self.aggregate_func == 'mean': - return torch.mean(emb, axis=0) - - def forward(self, src, dest, adj, mask, edges=None): - ''' - src.shape: (batch, src_cnt, src_dim) - dest.shape: (batch, dest_cnt, dest_dim) - adj.shape (ordered): (src_cnt, batch*dest_cnt) - mask.shape : (batch*dest_cnt)*src_cnt - edges.shape: (batch*dest_cnt, src_cnt, edge_dim) - ''' - assert(self.src_dim == src.shape[-1]) - assert(self.dest_dim== dest.shape[-1]) - batch, s_cnt, src_dim = src.shape - batch, d_cnt, dest_dim = dest.shape - - src_embedding = src.reshape(-1, src.shape[-1]) - src_embedding = torch.cat((self.zero_padding_template.to(src_embedding.get_device()), src_embedding)) - - # adj = adj[:,torch.randperm(adj.size()[1])] - flat_adj = adj.reshape(-1) - # src_cnt * (batch * dest_cnt) * src_dim - dest_embedding = src_embedding[flat_adj].reshape(adj.shape[0], -1, src.shape[-1]) - - if self.aggregate_func != 'decoder': - if edges is not None: - pre_input = torch.cat((dest_embedding, edges), axis=2) - else: - dest_rep = dest.reshape(-1, dest.shape[-1]).unsqueeze(0).repeat(adj.shape[0], 1, 1) - # src_cnt * (batch * dest_cnt) * (src_dim + dest_dim + edge_dim*) - if edges is None: - pre_input = torch.cat((dest_embedding, dest_rep), axis=2) - else: - pre_input = torch.cat((dest_embedding, dest_rep, edges), axis=2) - - encoder_input = self.pre_layer(pre_input.reshape(-1, pre_input.shape[-1])).reshape(*pre_input.shape[:2], self.hidden_size) - if self.enable_pe: - encoder_input = self.pe(encoder_input) - - # src_cnt * (batch*dest_cnt) * hidden_size - dest_emb = self.encoder(encoder_input, src_key_padding_mask=mask) - - # only get the first dimension - if self.aggregate_func == 'decoder': - dest_decode = self.decoder_fc(dest.reshape(batch*d_cnt, dest_dim)) - aggregated_emb = self.decoder(dest_decode.reshape(1, batch*d_cnt, self.hidden_size), dest_emb, memory_key_padding_mask=mask) - else: - aggregated_emb = self._aggregate(dest_emb) - return aggregated_emb.reshape(batch, d_cnt, self.hidden_size) - - -class TransGAT(nn.Module): - def __init__(self, p_dim, v_dim, edge_dim:dict, output_size, layer_num=2): - super().__init__() - self.hidden_size = output_size - self.layer_num = layer_num - - pl, vl, ppl = [], [], [] - for i in range(layer_num): - if i==0: - pl.append(TransGATLayer(v_dim, p_dim, edge_dim['v'], self.hidden_size, nhead=4, agreggate='decoder')) - vl.append(TransGATLayer(p_dim, v_dim, edge_dim['v'], self.hidden_size, nhead=4, agreggate='decoder')) - # p2p links - ppl.append(TransGATLayer(p_dim, p_dim, edge_dim['p'], self.hidden_size, nhead=4, agreggate='decoder', position_encoding=False)) - else: - pl.append(TransGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, agreggate='decoder')) - if i != layer_num - 1: - # p2v conv is not necessary at the last layer, for we only use port features - vl.append(TransGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, agreggate='decoder')) - ppl.append(TransGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, agreggate='decoder', position_encoding=False)) - self.p_layers = nn.ModuleList(pl) - self.v_layers = nn.ModuleList(vl) - self.pp_layers = nn.ModuleList(ppl) - - def forward(self, p, pe, v, ve, ppe): - # p.shape: (batch*p_cnt, p_dim) - pp = p - pre_p, pre_v, pre_pp = p, v, pp - for i in range(self.layer_num): - # only feed edge info in the first layer - p = self.p_layers[i](pre_v, pre_p, adj=pe['adj'], edges=pe['edge'] if i==0 else None, mask=pe['mask']) - if i != self.layer_num - 1: - v = self.v_layers[i](pre_p, pre_v, adj=ve['adj'], edges=ve['edge'] if i==0 else None, mask=ve['mask']) - pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe['adj'], edges=ppe['edge'] if i==0 else None, mask=ppe['mask']) - pre_p, pre_v, pre_pp = p, v, pp - p = torch.cat((p, pp), axis=2) - return p, v - -class GeLU(nn.Module): - def __init__(self): - super().__init__() - - def forward(self, input): - return F.gelu(input) - -class Norm(nn.Module): - def __init__(self, d_model, eps = 1e-6): - super().__init__() - - self.size = d_model - # create two learnable parameters to calibrate normalisation - self.alpha = nn.Parameter(torch.ones(self.size)) - self.bias = nn.Parameter(torch.zeros(self.size)) - self.eps = eps - - def forward(self, x): - norm = self.alpha * (x - x.mean(dim=-1, keepdim=True)) / (x.std(dim=-1, keepdim=True) + self.eps) + self.bias - return norm - -class TransformerEncoder(Module): - def __init__(self, encoder_layer, num_layers, norm=None): - super(TransformerEncoder, self).__init__() - self.layers = _get_clones(encoder_layer, num_layers) - self.num_layers = num_layers - self.norm = norm - - def forward(self, src, mask=None, src_key_padding_mask=None): - output = src - - for i in range(self.num_layers): - output = self.layers[i](output, src_mask=mask, - src_key_padding_mask=src_key_padding_mask) - - if self.norm: - output = self.norm(output) - - return output - -class TransformerDecoder(Module): - def __init__(self, decoder_layer, num_layers, norm=None): - super(TransformerDecoder, self).__init__() - self.layers = _get_clones(decoder_layer, num_layers) - self.num_layers = num_layers - self.norm = norm - - def forward(self, tgt, memory, tgt_mask=None, - memory_mask=None, tgt_key_padding_mask=None, - memory_key_padding_mask=None): - output = tgt - - for i in range(self.num_layers): - output = self.layers[i](output, memory, tgt_mask=tgt_mask, - memory_mask=memory_mask, - tgt_key_padding_mask=tgt_key_padding_mask, - memory_key_padding_mask=memory_key_padding_mask) - - if self.norm: - output = self.norm(output) - - return output - -class TransformerEncoderLayer(Module): - def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"): - super(TransformerEncoderLayer, self).__init__() - self.self_attn = MultiheadAttention(d_model, nhead, dropout=dropout) - # Implementation of Feedforward model - self.linear1 = Linear(d_model, dim_feedforward) - self.dropout = Dropout(dropout) - self.linear2 = Linear(dim_feedforward, d_model) - - self.norm1 = LayerNorm(d_model) - self.norm2 = LayerNorm(d_model) - self.dropout1 = Dropout(dropout) - self.dropout2 = Dropout(dropout) - - self.activation = _get_activation_fn(activation) - - def forward(self, src, src_mask=None, src_key_padding_mask=None): - src2, att = self.self_attn(src, src, src, attn_mask=src_mask, - key_padding_mask=src_key_padding_mask) - # np.save('./visualization/multi_attention.npy', att.cpu().detach().numpy()) - src = src + self.dropout1(src2) - src = self.norm1(src) - if hasattr(self, "activation"): - src2 = self.linear2(self.dropout(self.activation(self.linear1(src)))) - else: # for backward compatibility - src2 = self.linear2(self.dropout(F.relu(self.linear1(src)))) - src = src + self.dropout2(src2) - src = self.norm2(src) - return src - - -class CustomTransformerDecoderLayer(Module): - r"""TransformerDecoderLayer is made up of self-attn, multi-head-attn and feedforward network. - This standard decoder layer is based on the paper "Attention Is All You Need". - Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, - Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in - Neural Information Processing Systems, pages 6000-6010. Users may modify or implement - in a different way during application. - - Args: - d_model: the number of expected features in the input (required). - nhead: the number of heads in the multiheadattention models (required). - dim_feedforward: the dimension of the feedforward network model (default=2048). - dropout: the dropout value (default=0.1). - activation: the activation function of intermediate layer, relu or gelu (default=relu). - - Examples:: - >>> decoder_layer = nn.TransformerDecoderLayer(d_model=512, nhead=8) - >>> memory = torch.rand(10, 32, 512) - >>> tgt = torch.rand(20, 32, 512) - >>> out = decoder_layer(tgt, memory) - """ - - def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, activation="relu"): - super(CustomTransformerDecoderLayer, self).__init__() - # self.self_attn = MultiheadAttention(d_model, nhead, dropout=dropout) - self.multihead_attn = MultiheadAttention(d_model, nhead, dropout=dropout) - # Implementation of Feedforward model - self.linear1 = Linear(d_model, dim_feedforward) - self.dropout = Dropout(dropout) - self.linear2 = Linear(dim_feedforward, d_model) - - # self.norm1 = LayerNorm(d_model) - self.norm2 = LayerNorm(d_model) - self.norm3 = LayerNorm(d_model) - # self.dropout1 = Dropout(dropout) - self.dropout2 = Dropout(dropout) - self.dropout3 = Dropout(dropout) - - self.activation = _get_activation_fn(activation) - - def forward(self, tgt, memory, tgt_mask=None, memory_mask=None, - tgt_key_padding_mask=None, memory_key_padding_mask=None): - r"""Pass the inputs (and mask) through the decoder layer. - - Args: - tgt: the sequence to the decoder layer (required). - memory: the sequnce from the last layer of the encoder (required). - tgt_mask: the mask for the tgt sequence (optional). - memory_mask: the mask for the memory sequence (optional). - tgt_key_padding_mask: the mask for the tgt keys per batch (optional). - memory_key_padding_mask: the mask for the memory keys per batch (optional). - - Shape: - see the docs in Transformer class. - """ - # tgt2 = self.self_attn(tgt, tgt, tgt, attn_mask=tgt_mask, - # key_padding_mask=tgt_key_padding_mask)[0] - # tgt = tgt + self.dropout1(tgt2) - # tgt = self.norm1(tgt) - tgt2 = self.multihead_attn(tgt, memory, memory, attn_mask=memory_mask, - key_padding_mask=memory_key_padding_mask)[0] - tgt = tgt + self.dropout2(tgt2) - tgt = self.norm2(tgt) - if hasattr(self, "activation"): - tgt2 = self.linear2(self.dropout(self.activation(self.linear1(tgt)))) - else: # for backward compatibility - tgt2 = self.linear2(self.dropout(F.relu(self.linear1(tgt)))) - tgt = tgt + self.dropout3(tgt2) - tgt = self.norm3(tgt) - return tgt - -def _get_clones(module, N): - return ModuleList([copy.deepcopy(module) for i in range(N)]) - -def _get_activation_fn(activation): - if activation == "relu": - return F.relu - elif activation == "gelu": - return F.gelu - else: - raise RuntimeError("activation should be relu/gelu, not %s." % activation) \ No newline at end of file diff --git a/examples/ecr/gnn/utils.py b/examples/ecr/gnn/utils.py index 7179777c4..cc52ff96f 100644 --- a/examples/ecr/gnn/utils.py +++ b/examples/ecr/gnn/utils.py @@ -37,7 +37,7 @@ def warm_up_lr(opt, warmup_steps): def from_numpy(device, *np_values): return [torch.from_numpy(v).to(device) for v in np_values] -def differ_gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): +def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): ''' v: (seq_len, batch, v_cnt, v_dim) vo: (batch, v_cnt, p_cnt) @@ -97,78 +97,6 @@ def differ_gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): 'mask': seq_mask, } -def lstm_graph_union(v, p, vo, po, device, v2v=None, p2p=None): - batch, seq_len, v_cnt, v_dim = v.shape - _, _, p_cnt, p_dim = p.shape - - v = torch.from_numpy(v).to(device) - p = torch.from_numpy(p).to(device) - vo = torch.from_numpy(vo).to(device) - po = torch.from_numpy(po).to(device) - - v = v.transpose(0, 1) - p = p.transpose(0, 1) - vo = vo.transpose(0, 1) - po = po.transpose(0, 1) - - batch_range = torch.arange(batch*seq_len, dtype=torch.long).to(device) - vo = flatten_embedding(vo, batch_range) - po = flatten_embedding(po, batch_range) - - v = v.reshape(seq_len*batch*v_cnt, v_dim) - p = p.reshape(seq_len*batch*p_cnt, p_dim) - - ret = {'v': v, 'p': p, 'vo': vo, 'po': po} - - if v2v is not None: - v2v = torch.from_numpy(v2v).to(device).repeat(seq_len, batch, 1, 1) - v2v = flatten_embedding(v2v, batch_range) - ret['v2v'] = v2v - if p2p is not None: - p2p = torch.from_numpy(p2p).to(device).repeat(seq_len, batch, 1, 1) - p2p = flatten_embedding(p2p, batch_range) - ret['p2p'] = p2p - return ret - -def order_union(v, p, vo, po, device, v2v=None, p2p=None): - # batch = v.shape[0] - batch, v_cnt, seq_len, v_dim = v.shape - _, p_cnt, _, p_dim = p.shape - - v = torch.from_numpy(v).to(device) - p = torch.from_numpy(p).to(device) - vo = torch.from_numpy(vo).to(device) - po = torch.from_numpy(po).to(device) - - v = v.reshape(batch *v_cnt, seq_len, v_dim) - p = p.reshape(batch *p_cnt, seq_len, p_dim) - - batch_range = torch.arange(batch, dtype=torch.long).to(device) - vo = flatten_embedding(vo, batch_range) - po = flatten_embedding(po, batch_range) - - ret = {'v': v, 'p': p, 'vo': vo, 'po': po} - - if v2v is not None: - v2v = torch.from_numpy(v2v).to(device).repeat(batch, 1, 1) - v2v = flatten_embedding(v2v, batch_range) - ret['v2v'] = v2v - if p2p is not None: - p2p = torch.from_numpy(p2p).to(device).repeat(batch, 1, 1) - p2p = flatten_embedding(p2p, batch_range) - ret['p2p'] = p2p - - return ret - -def base_union(v, device): - # batch = v.shape[0] - batch, seq_len, v_dim = v.shape - v = v.reshape(batch, seq_len, v_dim) - # v = np.transpose(v,(1,0,2)) - v = torch.from_numpy(v).to(device) - - - return v def flatten_embedding(embedding, batch_range, edge=None): if len(embedding.shape) == 3: @@ -191,6 +119,9 @@ def flatten_embedding(embedding, batch_range, edge=None): return ret, edge def log2json(file_path): + """load the log file as a json list. + """ + with open(file_path, 'r') as fp: lines = fp.read().splitlines() json_list = '[' + ','.join(lines) + ']' @@ -330,29 +261,3 @@ def analysis_speed(env): eq_speed += 1.0*cnt/sp eq_speed = 1.0/eq_speed return speed_dict, eq_speed - - -if __name__ == "__main__": - for i in range(5): - - snapshot_list6 = zero_play(max_tick=500, scenario='ecr', topology='22p_global_l0.0') - sh6 = snapshot_list6.static_nodes[499:list(range(22)):('acc_shortage', 0)] - print(sh6) - print(sum(sh6)) - - snapshot_list7 = zero_play(max_tick=500, scenario='ecr', topology='22p_global_l0.0') - sh7 = snapshot_list7.static_nodes[499:list(range(22)):('acc_shortage', 0)] - print(sh7) - print(sum(sh7)) - - env6 = Env(max_tick=500, scenario='ecr', topology='22p_global_l0.0') - spd6, eq6 = analysis_speed(env6) - dd6 = decision_cnt_analysis(env6) - print(spd6) - print(dd6) - - env7 = Env(max_tick=500, scenario='ecr', topology='22p_global_l0.0') - spd7, eq7 = analysis_speed(env7) - dd7 = decision_cnt_analysis(env7) - print(spd7) - print(dd7) \ No newline at end of file From 60534e42efe0acf675c64fca2f5a00357cdb890e Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Wed, 23 Sep 2020 10:30:46 +0800 Subject: [PATCH 03/25] add the annotation for gnn and state shaper --- examples/ecr/gnn/config.yml | 8 +++++--- examples/ecr/gnn/launcher.py | 2 +- examples/ecr/gnn/learner.py | 2 +- examples/ecr/gnn/simple_gnn.py | 10 +++++++++- examples/ecr/gnn/state_shaper.py | 18 ++++++++++++++++-- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/examples/ecr/gnn/config.yml b/examples/ecr/gnn/config.yml index 525aed707..3d929dce8 100644 --- a/examples/ecr/gnn/config.yml +++ b/examples/ecr/gnn/config.yml @@ -8,8 +8,8 @@ env: training: enable: True parallel_cnt: 24 - device: 'cuda:1' - batch_size: 1024 + device: 'cuda:0' + batch_size: 150 shuffle_time: 1 rollout_cnt: 1000 train_freq: 1 @@ -27,7 +27,9 @@ model: graph_output_dim: 32 action_dim: 21 feature: - attention_order: temporal # meta_path_cnt, temporal or random + # temporal or random, if temporal, the edges in the graph are listed in the order of event time, else in a + # random order. + attention_order: temporal onehot_identity: False log: path: /dcdata/log/ diff --git a/examples/ecr/gnn/launcher.py b/examples/ecr/gnn/launcher.py index 6911c3306..7e926ebc3 100644 --- a/examples/ecr/gnn/launcher.py +++ b/examples/ecr/gnn/launcher.py @@ -59,7 +59,7 @@ # create and assemble agent_manager agent_id_list = list(config.env.exp_per_ep.keys()) training_logger = Logger(tag='training', dump_folder=config.log.path, dump_mode='w', auto_timestamp=False) - agent_manager = SimpleAgentManger("ecr-GNN-ma", agent_id_list, static_code_list, dynamic_code_list, demo_env, + agent_manager = SimpleAgentManger("CIM-GNN-manager", agent_id_list, static_code_list, dynamic_code_list, demo_env, gnn_state_shaper, training_logger) agent_manager.assemble(config) diff --git a/examples/ecr/gnn/learner.py b/examples/ecr/gnn/learner.py index 71cc2b6c4..ca9c17e29 100644 --- a/examples/ecr/gnn/learner.py +++ b/examples/ecr/gnn/learner.py @@ -7,7 +7,7 @@ class GNNLearner(AbsLearner): def __init__(self, actor: AbsActor, trainable_agents:AbsAgentManager, logger=DummyLogger()): - """Learner class for the training pipeline and the specialized logging in GNN solution for ECR problem. + """Learner class for the training pipeline and the specialized logging in GNN solution for CIM problem. Args: actor (AbsActor): The actor instance to collect experience. diff --git a/examples/ecr/gnn/simple_gnn.py b/examples/ecr/gnn/simple_gnn.py index d31474ad3..6aa4eca8d 100644 --- a/examples/ecr/gnn/simple_gnn.py +++ b/examples/ecr/gnn/simple_gnn.py @@ -136,7 +136,7 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor return dest_emb.reshape(batch, d_cnt, self.hidden_size) class SimpleGAT(nn.Module): - """Graph attention network with multiple graph in the ECR scenario. + """Graph attention network with multiple graph in the CIM scenario. This module aggregates information in the port-to-port graph, port-to-vessel graph and vessel-to-port graph. The aggregation in the two graph are done separatedly and then the port features are concatenated as the final result. @@ -244,6 +244,14 @@ def forward(self, x): class SharedAC(nn.Module): + """The actor-critic module shared with multiple agents. + + This module maps the input graph of the observation to the policy and value space. It first extracts the temporal + information separately for each node with a small transformer block and then extracts the spatial information with + a multi-graph/channel graph attention. Finally, the extracted feature embedding is fed to a actor header as well + as a critic layer, which are the two MLPs with residual connections. + """ + def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head='res'): super().__init__() assert(a or c) diff --git a/examples/ecr/gnn/state_shaper.py b/examples/ecr/gnn/state_shaper.py index b131a6a07..606a56fbc 100644 --- a/examples/ecr/gnn/state_shaper.py +++ b/examples/ecr/gnn/state_shaper.py @@ -4,8 +4,21 @@ from .utils import compute_v2p_degree_matrix class GNNStateShaper: + """State shaper to extract graph information. + + Args: + port_code_list (list): The list of the port codes in the CIM topology. + vessel_code_list (list): The list of the vessel code in the CIM topology. + max_tick (int): The duration of the simulation. + feature_config (dict): The dottable dict that stores the configuration of the observation feature. + max_value (int): The norm scale. All the feature are simply divided by this number. + tick_buffer (int): The value n in n-step TD. + only_demo (bool): Define if the shaper instance is used only for shape demonstration(True) or runtime + shaping(False). + """ + def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, - attention_order='temporal', tick_buffer=20, only_demo=False): + tick_buffer=20, only_demo=False): # collect and encode all ports self.port_code_list = list(port_code_list) self.port_cnt = len(self.port_code_list) @@ -34,7 +47,6 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m self._max_tick = max_tick self._tick_buffer = tick_buffer - self._attention_order = attention_order # to identify one vessel would never arrive at the port self.max_arrival_time = 99999999 @@ -94,6 +106,7 @@ def sort(self, arrival_time, attr=None): else: return at_index, attr + ''' def arg_idx(self, arrival_time, p_or_v): if self._feature_config.attention_order == 'temporal': return self.sort(arrival_time) @@ -102,6 +115,7 @@ def arg_idx(self, arrival_time, p_or_v): else: # randomize the arrival time return self.sort(arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape)) + ''' def end_ep_callback(self, snapshot_list): if self._only_demo: From 882ef26b37411f8124e7812dc9a51144d77e4c55 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Wed, 23 Sep 2020 18:50:52 +0800 Subject: [PATCH 04/25] rename to cim --- examples/{ecr => cim}/gnn/action_shaper.py | 0 examples/{ecr => cim}/gnn/actor.py | 18 +++++++++--------- examples/{ecr => cim}/gnn/actor_critic.py | 4 ++-- examples/{ecr => cim}/gnn/agent.py | 2 +- examples/{ecr => cim}/gnn/agent_manager.py | 12 ++++++------ examples/{ecr => cim}/gnn/config.yml | 6 +++--- examples/{ecr => cim}/gnn/experience_shaper.py | 0 examples/{ecr => cim}/gnn/launcher.py | 18 +++++++++--------- examples/{ecr => cim}/gnn/learner.py | 0 examples/{ecr => cim}/gnn/numpy_store.py | 0 examples/{ecr => cim}/gnn/shared_structure.py | 0 examples/{ecr => cim}/gnn/simple_gnn.py | 0 examples/{ecr => cim}/gnn/state_shaper.py | 0 examples/{ecr => cim}/gnn/utils.py | 2 +- .../global_trade.22p_l0.0/config.yml | 4 ++-- .../global_trade.22p_l0.1/config.yml | 4 ++-- .../global_trade.22p_l0.2/config.yml | 4 ++-- 17 files changed, 37 insertions(+), 37 deletions(-) rename examples/{ecr => cim}/gnn/action_shaper.py (100%) rename examples/{ecr => cim}/gnn/actor.py (96%) rename examples/{ecr => cim}/gnn/actor_critic.py (98%) rename examples/{ecr => cim}/gnn/agent.py (97%) rename examples/{ecr => cim}/gnn/agent_manager.py (93%) rename examples/{ecr => cim}/gnn/config.yml (90%) rename examples/{ecr => cim}/gnn/experience_shaper.py (100%) rename examples/{ecr => cim}/gnn/launcher.py (86%) rename examples/{ecr => cim}/gnn/learner.py (100%) rename examples/{ecr => cim}/gnn/numpy_store.py (100%) rename examples/{ecr => cim}/gnn/shared_structure.py (100%) rename examples/{ecr => cim}/gnn/simple_gnn.py (100%) rename examples/{ecr => cim}/gnn/state_shaper.py (100%) rename examples/{ecr => cim}/gnn/utils.py (99%) diff --git a/examples/ecr/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py similarity index 100% rename from examples/ecr/gnn/action_shaper.py rename to examples/cim/gnn/action_shaper.py diff --git a/examples/ecr/gnn/actor.py b/examples/cim/gnn/actor.py similarity index 96% rename from examples/ecr/gnn/actor.py rename to examples/cim/gnn/actor.py index 6f4e325c8..352ba40e4 100644 --- a/examples/ecr/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -9,18 +9,18 @@ from maro.simulator import Env from maro.rl import AbsActor -from examples.ecr.gnn.numpy_store import NumpyStore, Shuffler -from examples.ecr.gnn.action_shaper import DiscreteActionShaper -from examples.ecr.gnn.utils import fix_seed, gnn_union -from examples.ecr.gnn.experience_shaper import ExperienceShaper -from examples.ecr.gnn.state_shaper import GNNStateShaper +from examples.cim.gnn.numpy_store import NumpyStore, Shuffler +from examples.cim.gnn.action_shaper import DiscreteActionShaper +from examples.cim.gnn.utils import fix_seed, gnn_union +from examples.cim.gnn.experience_shaper import ExperienceShaper +from examples.cim.gnn.state_shaper import GNNStateShaper from collections import defaultdict, OrderedDict -from examples.ecr.gnn.actor_critic import ActorCritic +from examples.cim.gnn.actor_critic import ActorCritic from maro.simulator import Env -from maro.simulator.scenarios.ecr.common import Action, DecisionEvent +from maro.simulator.scenarios.cim.common import Action, DecisionEvent from maro.utils import Logger, LogFormat, convert_dottable -from examples.ecr.gnn.shared_structure import SharedStructure -from examples.ecr.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix +from examples.cim.gnn.shared_structure import SharedStructure +from examples.cim.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix import random diff --git a/examples/ecr/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py similarity index 98% rename from examples/ecr/gnn/actor_critic.py rename to examples/cim/gnn/actor_critic.py index 0a83ab221..0f9d5b035 100644 --- a/examples/ecr/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -8,7 +8,7 @@ from maro.rl import AbsAlgorithm -from examples.ecr.gnn.utils import gnn_union +from .utils import gnn_union class ActorCritic(AbsAlgorithm): def __init__(self, model: nn.Module, @@ -20,7 +20,7 @@ def __init__(self, model: nn.Module, entropy_factor=0.1): ''' - Actor-Critic algorithm in ECR problem. + Actor-Critic algorithm in CIM problem. Args: model (nn.Module): A actor-critic module outputing both the policy network and the value network diff --git a/examples/ecr/gnn/agent.py b/examples/cim/gnn/agent.py similarity index 97% rename from examples/ecr/gnn/agent.py rename to examples/cim/gnn/agent.py index 9961a82c3..48045332e 100644 --- a/examples/ecr/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -2,7 +2,7 @@ from maro.utils import DummyLogger import time from collections import defaultdict -from examples.ecr.gnn.numpy_store import Shuffler +from examples.cim.gnn.numpy_store import Shuffler import numpy as np class TrainableAgent(AbsAgent): diff --git a/examples/ecr/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py similarity index 93% rename from examples/ecr/gnn/agent_manager.py rename to examples/cim/gnn/agent_manager.py index 489205b68..f9969a931 100644 --- a/examples/ecr/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -1,10 +1,10 @@ from maro.rl import AbsAgentManager, AgentMode -from examples.ecr.gnn.agent import TrainableAgent -from examples.ecr.gnn.actor_critic import ActorCritic -# from examples.ecr.gnn.differ_gnn_model import SharedAC -from examples.ecr.gnn.simple_gnn import SharedAC -from examples.ecr.gnn.numpy_store import NumpyStore -from examples.ecr.gnn.utils import compute_v2p_degree_matrix +from examples.cim.gnn.agent import TrainableAgent +from examples.cim.gnn.actor_critic import ActorCritic +# from examples.cim.gnn.differ_gnn_model import SharedAC +from examples.cim.gnn.simple_gnn import SharedAC +from examples.cim.gnn.numpy_store import NumpyStore +from examples.cim.gnn.utils import compute_v2p_degree_matrix from maro.utils import DummyLogger import numpy as np from copy import copy diff --git a/examples/ecr/gnn/config.yml b/examples/cim/gnn/config.yml similarity index 90% rename from examples/ecr/gnn/config.yml rename to examples/cim/gnn/config.yml index 3d929dce8..b1ed28549 100644 --- a/examples/ecr/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -2,13 +2,13 @@ env: seed: 10 param: durations: 750 - scenario: "ecr" - topology: 'global_trade.22p_l0.0' + scenario: "cim" + topology: 'global_trade.22p_l0.1' # topology: "toy.4p_ssdd_l0.0" training: enable: True parallel_cnt: 24 - device: 'cuda:0' + device: 'cuda:1' batch_size: 150 shuffle_time: 1 rollout_cnt: 1000 diff --git a/examples/ecr/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py similarity index 100% rename from examples/ecr/gnn/experience_shaper.py rename to examples/cim/gnn/experience_shaper.py diff --git a/examples/ecr/gnn/launcher.py b/examples/cim/gnn/launcher.py similarity index 86% rename from examples/ecr/gnn/launcher.py rename to examples/cim/gnn/launcher.py index 7e926ebc3..6c49ccab8 100644 --- a/examples/ecr/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -1,23 +1,23 @@ import time, os import torch -from examples.ecr.gnn.numpy_store import NumpyStore, Shuffler +from examples.cim.gnn.numpy_store import NumpyStore, Shuffler import numpy as np -from examples.ecr.gnn.experience_shaper import ExperienceShaper +from examples.cim.gnn.experience_shaper import ExperienceShaper import multiprocessing from collections import defaultdict -from examples.ecr.gnn.actor import ParallelActor -from examples.ecr.gnn.learner import GNNLearner +from examples.cim.gnn.actor import ParallelActor +from examples.cim.gnn.learner import GNNLearner from maro.simulator import Env -from examples.ecr.gnn.state_shaper import GNNStateShaper -from examples.ecr.gnn.utils import decision_cnt_analysis, load_config, save_config, save_code, return_scaler -from examples.ecr.gnn.agent_manager import SimpleAgentManger +from examples.cim.gnn.state_shaper import GNNStateShaper +from examples.cim.gnn.utils import decision_cnt_analysis, load_config, save_config, save_code, return_scaler +from examples.cim.gnn.agent_manager import SimpleAgentManger from maro.utils import Logger, LogFormat import datetime import time if __name__ == "__main__": - config_pth = 'examples/ecr/gnn/config.yml' + config_pth = 'examples/cim/gnn/config.yml' config = load_config(config_pth) # generate log path. @@ -44,7 +44,7 @@ simulation_logger.info("Return value will be scaled down by the factor %f"%config.env.return_scaler) save_config(config, os.path.join(config.log.path, 'config.yml')) - save_code('examples/ecr/gnn',config.log.path) + save_code('examples/cim/gnn',config.log.path) port_mapping = demo_env.summary['node_mapping']['ports'] vessel_mapping = demo_env.summary['node_mapping']['vessels'] diff --git a/examples/ecr/gnn/learner.py b/examples/cim/gnn/learner.py similarity index 100% rename from examples/ecr/gnn/learner.py rename to examples/cim/gnn/learner.py diff --git a/examples/ecr/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py similarity index 100% rename from examples/ecr/gnn/numpy_store.py rename to examples/cim/gnn/numpy_store.py diff --git a/examples/ecr/gnn/shared_structure.py b/examples/cim/gnn/shared_structure.py similarity index 100% rename from examples/ecr/gnn/shared_structure.py rename to examples/cim/gnn/shared_structure.py diff --git a/examples/ecr/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py similarity index 100% rename from examples/ecr/gnn/simple_gnn.py rename to examples/cim/gnn/simple_gnn.py diff --git a/examples/ecr/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py similarity index 100% rename from examples/ecr/gnn/state_shaper.py rename to examples/cim/gnn/state_shaper.py diff --git a/examples/ecr/gnn/utils.py b/examples/cim/gnn/utils.py similarity index 99% rename from examples/ecr/gnn/utils.py rename to examples/cim/gnn/utils.py index cc52ff96f..37f928478 100644 --- a/examples/ecr/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -3,7 +3,7 @@ import json import ast, math from collections import defaultdict, OrderedDict -from maro.simulator.scenarios.ecr.common import Action, DecisionEvent +from maro.simulator.scenarios.cim.common import Action, DecisionEvent from maro.simulator import Env import shutil from maro.utils import convert_dottable, clone diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml index 2bec9bd4a..246614e29 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml @@ -6,9 +6,9 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.02 + - 0.012 - - 111 - - 0.02 + - 0.012 sample_noise: 0 container_volumes: - 1 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml index d5ff25c1a..81de3854e 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml @@ -6,9 +6,9 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.02 + - 0.012 - - 111 - - 0.02 + - 0.012 sample_noise: 0 container_volumes: - 1 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml index eed3f56b0..b295a14b1 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml @@ -6,9 +6,9 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.02 + - 0.012 - - 111 - - 0.02 + - 0.012 sample_noise: 0 container_volumes: - 1 From 96f058f8c98436550c09944ad31d21ba3f0d017b Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Wed, 23 Sep 2020 20:24:02 +0800 Subject: [PATCH 05/25] modify topology 22p --- .../global_trade.22p_l0.0/config.yml | 104 +-- .../global_trade.22p_l0.1/config.yml | 104 +-- .../global_trade.22p_l0.2/config.yml | 104 +-- .../global_trade.22p_l0.3/config.yml | 324 ++++---- .../global_trade.22p_l0.4/config.yml | 682 ++++++++-------- .../global_trade.22p_l0.5/config.yml | 682 ++++++++-------- .../global_trade.22p_l0.6/config.yml | 718 ++++++++--------- .../global_trade.22p_l0.7/config.yml | 730 +++++++++--------- .../global_trade.22p_l0.8/config.yml | 730 +++++++++--------- 9 files changed, 2089 insertions(+), 2089 deletions(-) diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml index 246614e29..33495fbc2 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml @@ -1,14 +1,10 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.012 + - 0.01 - - 111 - - 0.012 + - 0.01 sample_noise: 0 container_volumes: - 1 @@ -943,13 +939,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 7739 + capacity: 3869 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 7739 + capacity: 3869 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 4379 + capacity: 2189 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 4379 + capacity: 2189 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 46069 + capacity: 23034 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 46069 + capacity: 23034 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 9182 + capacity: 4591 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 9182 + capacity: 4591 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 11328 + capacity: 5664 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 11328 + capacity: 5664 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 52831 + capacity: 26415 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 52831 + capacity: 26415 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 52831 + capacity: 26415 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 52831 + capacity: 26415 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 52831 + capacity: 26415 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 52831 + capacity: 26415 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 39380 + capacity: 19690 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 39380 + capacity: 19690 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 39380 + capacity: 19690 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 19551 + capacity: 9775 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 19551 + capacity: 9775 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 19551 + capacity: 9775 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 17039 + capacity: 8519 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 17039 + capacity: 8519 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 17039 + capacity: 8519 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 7178 + capacity: 3589 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 7178 + capacity: 3589 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 7178 + capacity: 3589 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 7178 + capacity: 3589 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 7178 + capacity: 3589 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 5177 + capacity: 2588 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 5177 + capacity: 2588 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 5177 + capacity: 2588 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 5177 + capacity: 2588 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 9480 + capacity: 4740 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 9480 + capacity: 4740 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 9480 + capacity: 4740 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 9480 + capacity: 4740 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 9480 + capacity: 4740 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 9480 + capacity: 4740 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 50660 + capacity: 25330 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 50660 + capacity: 25330 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 50660 + capacity: 25330 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 50660 + capacity: 25330 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 50660 + capacity: 25330 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 50660 + capacity: 25330 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml index 81de3854e..15a5bce0a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml @@ -1,14 +1,10 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.012 + - 0.01 - - 111 - - 0.012 + - 0.01 sample_noise: 0 container_volumes: - 1 @@ -943,13 +939,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 580 + capacity: 290 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 580 + capacity: 290 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 328 + capacity: 164 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 328 + capacity: 164 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 3455 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 3455 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 688 + capacity: 344 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 688 + capacity: 344 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 849 + capacity: 424 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 849 + capacity: 424 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml index b295a14b1..15a5bce0a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml @@ -1,14 +1,10 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.012 + - 0.01 - - 111 - - 0.012 + - 0.01 sample_noise: 0 container_volumes: - 1 @@ -943,13 +939,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 522 + capacity: 290 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 580 + capacity: 290 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 360 + capacity: 164 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 296 + capacity: 164 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 3455 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 3800 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 620 + capacity: 344 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 688 + capacity: 344 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 933 + capacity: 424 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 765 + capacity: 424 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3248 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 2658 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1612 + capacity: 733 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1320 + capacity: 733 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1404 + capacity: 638 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1150 + capacity: 638 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 485 + capacity: 269 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 426 + capacity: 194 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml index 0915011f4..87ce885ce 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml @@ -1,234 +1,230 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.015 + - 0.005 - - 1 - - 0.015007865924910917 + - 0.005007865924910917 - - 2 - - 0.015031438950533788 + - 0.005031438950533787 - - 3 - - 0.015070644907408821 + - 0.005070644907408821 - - 4 - - 0.015125360439090883 + - 0.005125360439090882 - - 5 - - 0.015195413390274502 + - 0.005195413390274502 - - 6 - - 0.015280583348458162 + - 0.005280583348458163 - - 7 - - 0.015380602337443566 + - 0.005380602337443566 - - 8 - - 0.015495155660487904 + - 0.005495155660487905 - - 9 - - 0.015623882890456232 + - 0.0056238828904562315 - - 10 - - 0.015766379003858577 + - 0.0057663790038585796 - - 11 - - 0.0159221956552037 + - 0.005922195655203699 - - 12 - - 0.016090842587659852 + - 0.006090842587659851 - - 13 - - 0.016271789175584174 + - 0.006271789175584172 - - 14 - - 0.01646446609406726 + - 0.006464466094067262 - - 15 - - 0.01666826711023998 + - 0.006668267110239981 - - 16 - - 0.016882550990706333 + - 0.006882550990706332 - - 17 - - 0.017106643519100972 + - 0.007106643519100972 - - 18 - - 0.017339839617423317 + - 0.007339839617423317 - - 19 - - 0.017581405564473802 + - 0.007581405564473801 - - 20 - - 0.01783058130441221 + - 0.007830581304412209 - - 21 - - 0.01808658283817455 + - 0.00808658283817455 - - 22 - - 0.018348604690224164 + - 0.008348604690224165 - - 23 - - 0.018615822442875754 + - 0.008615822442875754 - - 24 - - 0.018887395330218427 + - 0.008887395330218428 - - 25 - - 0.01916246888347632 + - 0.009162468883476318 - - 26 - - 0.01944017761948346 + - 0.00944017761948346 - - 27 - - 0.01971964776381404 + - 0.009719647763814041 - - 28 - - 0.02 + - 0.01 - - 29 - - 0.02028035223618596 + - 0.01028035223618596 - - 30 - - 0.02055982238051654 + - 0.010559822380516538 - - 31 - - 0.020837531116523682 + - 0.010837531116523682 - - 32 - - 0.02111260466978157 + - 0.011112604669781572 - - 33 - - 0.021384177557124247 + - 0.011384177557124247 - - 34 - - 0.021651395309775834 + - 0.011651395309775834 - - 35 - - 0.02191341716182545 + - 0.011913417161825448 - - 36 - - 0.022169418695587792 + - 0.01216941869558779 - - 37 - - 0.0224185944355262 + - 0.0124185944355262 - - 38 - - 0.022660160382576684 + - 0.012660160382576682 - - 39 - - 0.02289335648089903 + - 0.012893356480899029 - - 40 - - 0.023117449009293668 + - 0.013117449009293668 - - 41 - - 0.02333173288976002 + - 0.01333173288976002 - - 42 - - 0.023535533905932736 + - 0.013535533905932737 - - 43 - - 0.023728210824415827 + - 0.013728210824415828 - - 44 - - 0.02390915741234015 + - 0.01390915741234015 - - 45 - - 0.0240778043447963 + - 0.014077804344796302 - - 46 - - 0.02423362099614142 + - 0.014233620996141422 - - 47 - - 0.02437611710954377 + - 0.014376117109543769 - - 48 - - 0.024504844339512097 + - 0.014504844339512095 - - 49 - - 0.024619397662556435 + - 0.014619397662556434 - - 50 - - 0.02471941665154184 + - 0.014719416651541837 - - 51 - - 0.0248045866097255 + - 0.014804586609725497 - - 52 - - 0.024874639560909118 + - 0.014874639560909118 - - 53 - - 0.024929355092591178 + - 0.01492935509259118 - - 54 - - 0.024968561049466213 + - 0.014968561049466214 - - 55 - - 0.024992134075089083 + - 0.014992134075089083 - - 56 - - 0.025 + - 0.015 - - 57 - - 0.024992134075089083 + - 0.014992134075089083 - - 58 - - 0.024968561049466213 + - 0.014968561049466212 - - 59 - - 0.024929355092591178 + - 0.01492935509259118 - - 60 - - 0.024874639560909118 + - 0.014874639560909118 - - 61 - - 0.0248045866097255 + - 0.014804586609725499 - - 62 - - 0.02471941665154184 + - 0.014719416651541837 - - 63 - - 0.024619397662556435 + - 0.014619397662556434 - - 64 - - 0.024504844339512097 + - 0.014504844339512095 - - 65 - - 0.02437611710954377 + - 0.014376117109543767 - - 66 - - 0.024233620996141424 + - 0.014233620996141422 - - 67 - - 0.024077804344796304 + - 0.014077804344796302 - - 68 - - 0.023909157412340152 + - 0.01390915741234015 - - 69 - - 0.02372821082441583 + - 0.013728210824415828 - - 70 - - 0.02353553390593274 + - 0.01353553390593274 - - 71 - - 0.02333173288976002 + - 0.01333173288976002 - - 72 - - 0.023117449009293668 + - 0.01311744900929367 - - 73 - - 0.02289335648089903 + - 0.012893356480899027 - - 74 - - 0.022660160382576684 + - 0.012660160382576684 - - 75 - - 0.022418594435526202 + - 0.012418594435526202 - - 76 - - 0.022169418695587792 + - 0.012169418695587792 - - 77 - - 0.021913417161825453 + - 0.011913417161825451 - - 78 - - 0.021651395309775837 + - 0.011651395309775837 - - 79 - - 0.021384177557124247 + - 0.011384177557124247 - - 80 - - 0.021112604669781574 + - 0.011112604669781574 - - 81 - - 0.020837531116523686 + - 0.010837531116523686 - - 82 - - 0.02055982238051654 + - 0.01055982238051654 - - 83 - - 0.020280352236185958 + - 0.010280352236185957 - - 84 - - 0.02 + - 0.010000000000000002 - - 85 - - 0.019719647763814043 + - 0.009719647763814045 - - 86 - - 0.01944017761948346 + - 0.009440177619483462 - - 87 - - 0.01916246888347632 + - 0.009162468883476316 - - 88 - - 0.01888739533021843 + - 0.008887395330218428 - - 89 - - 0.018615822442875758 + - 0.008615822442875756 - - 90 - - 0.018348604690224167 + - 0.008348604690224165 - - 91 - - 0.01808658283817455 + - 0.00808658283817455 - - 92 - - 0.01783058130441221 + - 0.00783058130441221 - - 93 - - 0.0175814055644738 + - 0.0075814055644738 - - 94 - - 0.01733983961742332 + - 0.007339839617423318 - - 95 - - 0.017106643519100975 + - 0.007106643519100974 - - 96 - - 0.016882550990706333 + - 0.006882550990706333 - - 97 - - 0.01666826711023998 + - 0.006668267110239979 - - 98 - - 0.016464466094067265 + - 0.006464466094067263 - - 99 - - 0.016271789175584174 + - 0.006271789175584174 - - 100 - - 0.016090842587659852 + - 0.006090842587659851 - - 101 - - 0.015922195655203697 + - 0.0059221956552036985 - - 102 - - 0.01576637900385858 + - 0.00576637900385858 - - 103 - - 0.015623882890456233 + - 0.005623882890456233 - - 104 - - 0.015495155660487904 + - 0.005495155660487905 - - 105 - - 0.015380602337443568 + - 0.005380602337443568 - - 106 - - 0.015280583348458162 + - 0.005280583348458163 - - 107 - - 0.015195413390274502 + - 0.005195413390274502 - - 108 - - 0.015125360439090883 + - 0.005125360439090882 - - 109 - - 0.015070644907408821 + - 0.005070644907408821 - - 110 - - 0.015031438950533788 + - 0.005031438950533787 - - 111 - - 0.015007865924910917 + - 0.005007865924910917 sample_noise: 0 container_volumes: - 1 @@ -1163,13 +1159,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 522 + capacity: 290 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 580 + capacity: 290 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 360 + capacity: 164 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 296 + capacity: 164 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 3455 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 3800 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 620 + capacity: 344 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 688 + capacity: 344 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 933 + capacity: 424 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 765 + capacity: 424 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3248 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 2658 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1612 + capacity: 733 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1320 + capacity: 733 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1404 + capacity: 638 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1150 + capacity: 638 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 485 + capacity: 269 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 426 + capacity: 194 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml index 6d6afb35e..2661dac99 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml @@ -1,234 +1,230 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.015 + - 0.005 - - 1 - - 0.015007865924910917 + - 0.005007865924910917 - - 2 - - 0.015031438950533788 + - 0.005031438950533787 - - 3 - - 0.015070644907408821 + - 0.005070644907408821 - - 4 - - 0.015125360439090883 + - 0.005125360439090882 - - 5 - - 0.015195413390274502 + - 0.005195413390274502 - - 6 - - 0.015280583348458162 + - 0.005280583348458163 - - 7 - - 0.015380602337443566 + - 0.005380602337443566 - - 8 - - 0.015495155660487904 + - 0.005495155660487905 - - 9 - - 0.015623882890456232 + - 0.0056238828904562315 - - 10 - - 0.015766379003858577 + - 0.0057663790038585796 - - 11 - - 0.0159221956552037 + - 0.005922195655203699 - - 12 - - 0.016090842587659852 + - 0.006090842587659851 - - 13 - - 0.016271789175584174 + - 0.006271789175584172 - - 14 - - 0.01646446609406726 + - 0.006464466094067262 - - 15 - - 0.01666826711023998 + - 0.006668267110239981 - - 16 - - 0.016882550990706333 + - 0.006882550990706332 - - 17 - - 0.017106643519100972 + - 0.007106643519100972 - - 18 - - 0.017339839617423317 + - 0.007339839617423317 - - 19 - - 0.017581405564473802 + - 0.007581405564473801 - - 20 - - 0.01783058130441221 + - 0.007830581304412209 - - 21 - - 0.01808658283817455 + - 0.00808658283817455 - - 22 - - 0.018348604690224164 + - 0.008348604690224165 - - 23 - - 0.018615822442875754 + - 0.008615822442875754 - - 24 - - 0.018887395330218427 + - 0.008887395330218428 - - 25 - - 0.01916246888347632 + - 0.009162468883476318 - - 26 - - 0.01944017761948346 + - 0.00944017761948346 - - 27 - - 0.01971964776381404 + - 0.009719647763814041 - - 28 - - 0.02 + - 0.01 - - 29 - - 0.02028035223618596 + - 0.01028035223618596 - - 30 - - 0.02055982238051654 + - 0.010559822380516538 - - 31 - - 0.020837531116523682 + - 0.010837531116523682 - - 32 - - 0.02111260466978157 + - 0.011112604669781572 - - 33 - - 0.021384177557124247 + - 0.011384177557124247 - - 34 - - 0.021651395309775834 + - 0.011651395309775834 - - 35 - - 0.02191341716182545 + - 0.011913417161825448 - - 36 - - 0.022169418695587792 + - 0.01216941869558779 - - 37 - - 0.0224185944355262 + - 0.0124185944355262 - - 38 - - 0.022660160382576684 + - 0.012660160382576682 - - 39 - - 0.02289335648089903 + - 0.012893356480899029 - - 40 - - 0.023117449009293668 + - 0.013117449009293668 - - 41 - - 0.02333173288976002 + - 0.01333173288976002 - - 42 - - 0.023535533905932736 + - 0.013535533905932737 - - 43 - - 0.023728210824415827 + - 0.013728210824415828 - - 44 - - 0.02390915741234015 + - 0.01390915741234015 - - 45 - - 0.0240778043447963 + - 0.014077804344796302 - - 46 - - 0.02423362099614142 + - 0.014233620996141422 - - 47 - - 0.02437611710954377 + - 0.014376117109543769 - - 48 - - 0.024504844339512097 + - 0.014504844339512095 - - 49 - - 0.024619397662556435 + - 0.014619397662556434 - - 50 - - 0.02471941665154184 + - 0.014719416651541837 - - 51 - - 0.0248045866097255 + - 0.014804586609725497 - - 52 - - 0.024874639560909118 + - 0.014874639560909118 - - 53 - - 0.024929355092591178 + - 0.01492935509259118 - - 54 - - 0.024968561049466213 + - 0.014968561049466214 - - 55 - - 0.024992134075089083 + - 0.014992134075089083 - - 56 - - 0.025 + - 0.015 - - 57 - - 0.024992134075089083 + - 0.014992134075089083 - - 58 - - 0.024968561049466213 + - 0.014968561049466212 - - 59 - - 0.024929355092591178 + - 0.01492935509259118 - - 60 - - 0.024874639560909118 + - 0.014874639560909118 - - 61 - - 0.0248045866097255 + - 0.014804586609725499 - - 62 - - 0.02471941665154184 + - 0.014719416651541837 - - 63 - - 0.024619397662556435 + - 0.014619397662556434 - - 64 - - 0.024504844339512097 + - 0.014504844339512095 - - 65 - - 0.02437611710954377 + - 0.014376117109543767 - - 66 - - 0.024233620996141424 + - 0.014233620996141422 - - 67 - - 0.024077804344796304 + - 0.014077804344796302 - - 68 - - 0.023909157412340152 + - 0.01390915741234015 - - 69 - - 0.02372821082441583 + - 0.013728210824415828 - - 70 - - 0.02353553390593274 + - 0.01353553390593274 - - 71 - - 0.02333173288976002 + - 0.01333173288976002 - - 72 - - 0.023117449009293668 + - 0.01311744900929367 - - 73 - - 0.02289335648089903 + - 0.012893356480899027 - - 74 - - 0.022660160382576684 + - 0.012660160382576684 - - 75 - - 0.022418594435526202 + - 0.012418594435526202 - - 76 - - 0.022169418695587792 + - 0.012169418695587792 - - 77 - - 0.021913417161825453 + - 0.011913417161825451 - - 78 - - 0.021651395309775837 + - 0.011651395309775837 - - 79 - - 0.021384177557124247 + - 0.011384177557124247 - - 80 - - 0.021112604669781574 + - 0.011112604669781574 - - 81 - - 0.020837531116523686 + - 0.010837531116523686 - - 82 - - 0.02055982238051654 + - 0.01055982238051654 - - 83 - - 0.020280352236185958 + - 0.010280352236185957 - - 84 - - 0.02 + - 0.010000000000000002 - - 85 - - 0.019719647763814043 + - 0.009719647763814045 - - 86 - - 0.01944017761948346 + - 0.009440177619483462 - - 87 - - 0.01916246888347632 + - 0.009162468883476316 - - 88 - - 0.01888739533021843 + - 0.008887395330218428 - - 89 - - 0.018615822442875758 + - 0.008615822442875756 - - 90 - - 0.018348604690224167 + - 0.008348604690224165 - - 91 - - 0.01808658283817455 + - 0.00808658283817455 - - 92 - - 0.01783058130441221 + - 0.00783058130441221 - - 93 - - 0.0175814055644738 + - 0.0075814055644738 - - 94 - - 0.01733983961742332 + - 0.007339839617423318 - - 95 - - 0.017106643519100975 + - 0.007106643519100974 - - 96 - - 0.016882550990706333 + - 0.006882550990706333 - - 97 - - 0.01666826711023998 + - 0.006668267110239979 - - 98 - - 0.016464466094067265 + - 0.006464466094067263 - - 99 - - 0.016271789175584174 + - 0.006271789175584174 - - 100 - - 0.016090842587659852 + - 0.006090842587659851 - - 101 - - 0.015922195655203697 + - 0.0059221956552036985 - - 102 - - 0.01576637900385858 + - 0.00576637900385858 - - 103 - - 0.015623882890456233 + - 0.005623882890456233 - - 104 - - 0.015495155660487904 + - 0.005495155660487905 - - 105 - - 0.015380602337443568 + - 0.005380602337443568 - - 106 - - 0.015280583348458162 + - 0.005280583348458163 - - 107 - - 0.015195413390274502 + - 0.005195413390274502 - - 108 - - 0.015125360439090883 + - 0.005125360439090882 - - 109 - - 0.015070644907408821 + - 0.005070644907408821 - - 110 - - 0.015031438950533788 + - 0.005031438950533787 - - 111 - - 0.015007865924910917 + - 0.005007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -245,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.025134751494652507 + noise: 0.013443725935320523 proportion: 0.16 targets: leHavre_fra: - noise: 0.025432733187591285 + noise: 0.030270714085038748 proportion: 0.18755329471737509 montreal_can: - noise: 0.014981815264884504 + noise: 0.013320576022818739 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07860790872534353 + noise: 0.07689493882565487 proportion: 0.47933778254893905 pusan_kor: - noise: 0.002902145091237068 + noise: 0.007972433806655532 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.0016703057083900894 + noise: 0.007497817787595211 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.004329384963154748 + noise: 0.007633866843340292 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.00014700838968303593 + noise: 0.0010106861866602764 proportion: 0.005882857005910926 yantian_chn: - noise: 0.014277274600949947 + noise: 0.012219624836344655 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -283,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003905851406890507 + noise: 0.0019530280872261515 proportion: 0.01 targets: qingdao_chn: - noise: 0.03386602700899302 + noise: 0.0034939030178053614 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04099351916502508 + noise: 0.04233393468254242 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.02983331512414685 + noise: 0.021838198102471493 proportion: 0.24812321657873454 yantian_chn: - noise: 0.0398838857119423 + noise: 0.046242815176850596 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -309,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017049012580563228 + noise: 0.0019129579921117862 proportion: 0.01 targets: qingdao_chn: - noise: 0.006704071585248814 + noise: 0.012228512488579733 proportion: 0.19992517767067194 santos_bra: - noise: 0.01065215665926791 + noise: 0.028078880905400762 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.01889939427623029 + noise: 0.023876351340743802 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.030425501405892584 + noise: 0.029319437252031597 proportion: 0.19775168293424744 yantian_chn: - noise: 0.0038049637706619867 + noise: 0.01928917747193642 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -338,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.010023093144315015 + noise: 0.00350760127602979 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.046713884416130814 + noise: 0.032528716547168546 proportion: 0.2613085269688243 montreal_can: - noise: 0.007011738109808054 + noise: 0.014821251534050164 proportion: 0.09474419644790176 newYork_usa: - noise: 0.0075575968616494 + noise: 0.02447312721184167 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0022204132834372364 + noise: 0.0043063159539580825 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0025163323117031356 + noise: 0.0061997544295394206 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.012253843912920523 + noise: 0.0014225749496497644 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.014556815408633276 + noise: 0.0049886669336311005 proportion: 0.07609945087001035 yantian_chn: - noise: 0.007509358525794673 + noise: 0.010202155612950937 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -376,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007441531984981497 + noise: 0.007116233975121642 proportion: 0.05 targets: oakland_usa: - noise: 0.04265188459544233 + noise: 0.021750420577675664 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.00273897680516611 + noise: 0.007223156875444034 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.01517255937598155 + noise: 0.008409198610215574 proportion: 0.1623492157793647 seattle_usa: - noise: 0.014299850500812094 + noise: 0.04468140938124822 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.0051011672478115 + noise: 0.022579209428659604 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -405,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.005425915310841583 + noise: 0.001237859415806274 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0073296927183103605 + noise: 0.004468190881652269 proportion: 0.1642819028757581 pusan_kor: - noise: 0.018169915140256784 + noise: 0.015630343651636142 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.02383787277319661 + noise: 0.01705599320218467 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.0025563544317216205 + noise: 0.002949720393204809 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.02058384394808081 + noise: 0.0062556847598889565 proportion: 0.11985637174894495 yantian_chn: - noise: 0.00989286132515691 + noise: 0.017417960137127892 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.0007488162438248653 + noise: 0.027064881430223564 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -440,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029979553756433923 + noise: 0.0022241630073084333 proportion: 0.015 targets: singapore_sgp: - noise: 0.0566906410775888 + noise: 0.04113598506120082 proportion: 0.3293364398135728 sydney_aus: - noise: 0.01865388192132147 + noise: 0.05585356106243802 proportion: 0.3364188275147848 yantian_chn: - noise: 0.014238633997660635 + noise: 0.04970952158933521 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -463,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0005621554647653919 + noise: 0.0023396017313775798 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08779643369212999 + noise: 0.029006641730691472 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.07842477295179612 + noise: 0.052743138595601397 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -483,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00016057717079772171 + noise: 0.0029698121952597563 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.05981761122488196 + noise: 0.002300273308223476 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.03990533991720246 + noise: 0.026329645545883667 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -503,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.004910915544061917 + noise: 0.00034658625196087867 proportion: 0.03 targets: losAngeles_usa: - noise: 0.048963812038470556 + noise: 0.03805042564171647 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.0254961817963097 + noise: 0.026783528316198884 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03349874892050399 + noise: 0.02520719401293405 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.012993114869682515 + noise: 0.011450474320078908 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -529,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027667472862969076 + noise: 0.0027574439469690735 proportion: 0.015 targets: losAngeles_usa: - noise: 0.05091486367601389 + noise: 0.030666144891490648 proportion: 0.2657898185062753 oakland_usa: - noise: 0.028397329439457514 + noise: 0.05069695864471698 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.0016646658939369785 + noise: 1.5150697900596916e-05 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.013742472852754001 + noise: 0.005507254948856576 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -555,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.009320427377742116 + noise: 0.003886006717160586 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.031991420231325084 + noise: 0.027386818215617247 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.005105457599858164 + noise: 0.011340855749132506 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.005809147275802185 + noise: 0.0015411008699796073 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0033945457967072133 + noise: 0.0011819920685648456 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.001854192137165468 + noise: 0.005415688613917366 proportion: 0.035795894860646466 seattle_usa: - noise: 0.018330317944630015 + noise: 0.012679066272107449 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.009459052846765289 + noise: 0.004046325432066565 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0016197423680226325 + noise: 0.004754201755016008 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00469787131269142 + noise: 0.010845469930487786 proportion: 0.059258114284493034 yantian_chn: - noise: 0.003856257701007031 + noise: 0.009847287555290789 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.014803870326138143 + noise: 0.016857865956875252 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -602,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.007181454765417904 + noise: 0.0013405281331279736 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02952708760272511 + noise: 0.017720647298623885 proportion: 0.19166868266386958 durban_sau: - noise: 0.0026860007722877676 + noise: 0.004430489262425184 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0023058721270403397 + noise: 0.0029551319318284 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.008262798336030506 + noise: 0.00884618941305856 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.014599621251693524 + noise: 0.008287055306659491 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.004578888771735588 + noise: 0.010416910937371144 proportion: 0.061252276599797005 oakland_usa: - noise: 0.0018968128853613635 + noise: 0.030726016025509867 proportion: 0.15590868899027802 princeRupert_can: - noise: 7.825075850514062e-05 + noise: 0.001029469211236195 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0007151691535729856 + noise: 0.00253441394213481 proportion: 0.018577689927305203 santos_bra: - noise: 0.0036806154087330586 + noise: 0.0012007740198499907 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0016116464454415448 + noise: 0.015740512852146334 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0011503058311188963 + noise: 0.001828465916657425 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0031091344585237185 + noise: 0.000962793819981486 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0017512950798533396 + noise: 0.001870686969127809 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.023837737047619264 + noise: 0.020726812866609105 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -661,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0015229565945744795 + noise: 0.00046662157321829305 proportion: 0.01 targets: manzanillo_mex: - noise: 0.029864110340333205 + noise: 0.0335790014316909 proportion: 0.1695702560614863 pusan_kor: - noise: 0.030434021872288986 + noise: 0.019876836766735944 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.031654173870326326 + noise: 0.021055304334577304 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.022840905205567065 + noise: 0.010351683215713024 proportion: 0.16105317774270345 yantian_chn: - noise: 0.022058626605590343 + noise: 0.020655951601841832 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.020882193597463152 + noise: 0.009059407942596073 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -693,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017591918390130468 + noise: 0.0003480997833509656 proportion: 0.01 targets: itagual_bra: - noise: 0.00015677478442405662 + noise: 0.020657961926928516 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.007951708444894913 + noise: 0.013072578761377065 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.008394529742993468 + noise: 0.027172218926956353 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01406059678653582 + noise: 0.028255176146783356 proportion: 0.19775168256638195 yantian_chn: - noise: 0.011310434190498734 + noise: 0.02522960406069968 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -722,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.009178972285261822 + noise: 0.0007339846715492771 proportion: 0.07 targets: losAngeles_usa: - noise: 0.023523817623575388 + noise: 0.005803300102787883 proportion: 0.2912736754142012 pusan_kor: - noise: 0.01876947062956955 + noise: 0.011767093399526167 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.02029673306956859 + noise: 0.01342850609637382 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.011329185762784782 + noise: 0.02208223845904732 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.00024014816912197655 + noise: 0.01317084017907106 proportion: 0.09977785851511455 vancouver_can: - noise: 0.02057342705041732 + noise: 0.0032415669173149184 proportion: 0.1273542861551621 yantian_chn: - noise: 0.020083358186626803 + noise: 0.01697269521746073 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -757,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017109626305467616 + noise: 0.014530243985042664 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.021959106592952006 + noise: 0.02131285237332896 proportion: 0.21398371679064213 durban_sau: - noise: 0.00010435314516980227 + noise: 0.002948998809093681 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0020594969751376174 + noise: 0.001713993122608175 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009873199353313093 + noise: 0.0009800848688656188 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.014743978442771179 + noise: 0.0050873385069792705 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.0012374290703743276 + noise: 0.004983219928480878 proportion: 0.05976808154382374 oakland_usa: - noise: 0.022426459611386496 + noise: 0.021596249916838263 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0005070099495173756 + noise: 0.0014764151425764754 proportion: 0.00930596400725694 qingdao_chn: - noise: 1.8783239577936313e-05 + noise: 2.741759926803036e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0012407696401487867 + noise: 0.0003052926172722117 proportion: 0.011430536346128936 seattle_usa: - noise: 0.011299147787220907 + noise: 0.01952308695587358 proportion: 0.12100465463531186 vancouver_can: - noise: 0.002147321460772641 + noise: 0.0019949337867570943 proportion: 0.011092475826618629 yantian_chn: - noise: 0.000883163479902347 + noise: 0.0005520948508266831 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.012495339718107597 + noise: 0.015187739134572683 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -813,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0014198451145378962 + noise: 0.005693120029153821 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02403294164090424 + noise: 0.020122388762735893 proportion: 0.16163465526933787 durban_sau: - noise: 0.007339857249890276 + noise: 0.0019491514734383516 proportion: 0.052947229587582224 itagual_bra: - noise: 0.004826948332878951 + noise: 0.0002586292721110565 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.000697323478201817 + noise: 0.004984389187243039 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.009748446374379698 + noise: 0.0015861611856993322 proportion: 0.054598902525719965 pusan_kor: - noise: 0.0052864459821632135 + noise: 0.006025000972759821 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.00020264478777542088 + noise: 0.0004286935806667211 proportion: 0.04380756610509279 santos_bra: - noise: 0.0060662606703405855 + noise: 0.003416715058071535 proportion: 0.0496114180206766 seattle_usa: - noise: 0.002184489196293904 + noise: 0.007700381604340727 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.00446890645579302 + noise: 0.003544364668028845 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.0005079804300151535 + noise: 0.002802086921079384 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0032814259751614335 + noise: 0.010185014617976348 proportion: 0.053961624659387086 vancouver_can: - noise: 0.0013725415556900408 + noise: 0.002789491330076127 proportion: 0.04942443509903704 yantian_chn: - noise: 0.007866049277209214 + noise: 0.005000384119150195 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.013995694253814077 + noise: 0.008577499395403343 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -872,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 5.318259543305715e-05 + noise: 0.002150752663893203 proportion: 0.015 targets: melbourne_aus: - noise: 0.010959524006592607 + noise: 0.05922344082123652 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.013378806626384264 + noise: 0.05193975256137971 proportion: 0.3291642505650358 yantian_chn: - noise: 0.043398566324619615 + noise: 0.061788693147246415 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -895,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002260078974868654 + noise: 0.002068294648050253 proportion: 0.02 targets: pusan_kor: - noise: 0.01022517907397126 + noise: 0.016845200307234364 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.025111111836521687 + noise: 0.014999981061310954 proportion: 0.16078294599848347 seattle_usa: - noise: 0.025666860266381805 + noise: 0.01896644075283542 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.00391575019491024 + noise: 0.0077549932712456865 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009869415376296499 + noise: 0.02055123864749911 proportion: 0.15641751563334233 yantian_chn: - noise: 0.01646828787230074 + noise: 0.03050803433828264 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -927,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.005460106707641842 + noise: 0.002609757843993272 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.03183934815230198 + noise: 0.025222997739158936 proportion: 0.23063506921338092 durban_sau: - noise: 0.006955761417407662 + noise: 0.0018608540738386267 proportion: 0.036977112629701755 itagual_bra: - noise: 0.003879986047538319 + noise: 0.004923606222292092 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.0033746270986396783 + noise: 0.012389321950936184 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.014297914647911386 + noise: 0.003548726911160303 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.0055998037357593185 + noise: 0.000882486825036804 proportion: 0.03992004007199072 pusan_kor: - noise: 0.004337884540903886 + noise: 0.0005349297708399651 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0034845335834618927 + noise: 0.0007216029643777133 proportion: 0.020692152164438926 santos_bra: - noise: 0.0023084677027446535 + noise: 0.0008948241044821844 proportion: 0.03103337095193521 seattle_usa: - noise: 0.0043141199296154705 + noise: 0.006808164648780424 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0001996474876791818 + noise: 0.0019668709850992473 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0011502086812016938 + noise: 0.0008244631028521047 proportion: 0.006007386215135132 sydney_aus: - noise: 0.0019319056238978993 + noise: 0.003274678869997879 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0007858696914021227 + noise: 0.0003213862877618055 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0016168667042640794 + noise: 0.0026076979418575303 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.023246811699828965 + noise: 0.026806722998433646 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -989,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.014254332625813097 + noise: 0.011506949353344573 proportion: 0.08 targets: manzanillo_mex: - noise: 0.03244047063421112 + noise: 0.042678902760188174 proportion: 0.224773870587767 pusan_kor: - noise: 0.018126081484701975 + noise: 0.02092931566180752 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.017152304680050526 + noise: 0.012790853044052902 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.0003086488347039955 + noise: 0.00713764692173517 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0056287128415065625 + noise: 0.018867879170398616 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.019438990767313084 + noise: 0.014299288167726593 proportion: 0.1115894561579222 yantian_chn: - noise: 0.014838419143613479 + noise: 0.010558592890221315 proportion: 0.14697441091807414 routes: a3s: @@ -1163,13 +1159,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 522 + capacity: 290 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 580 + capacity: 290 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 360 + capacity: 164 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 296 + capacity: 164 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 3455 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 3800 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 620 + capacity: 344 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 688 + capacity: 344 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 933 + capacity: 424 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 765 + capacity: 424 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3248 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 2658 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1612 + capacity: 733 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1320 + capacity: 733 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1404 + capacity: 638 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1150 + capacity: 638 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 485 + capacity: 269 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 426 + capacity: 194 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml index b0a88cf15..f7c988233 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml @@ -1,234 +1,230 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.015 + - 0.005 - - 1 - - 0.015007865924910917 + - 0.005007865924910917 - - 2 - - 0.015031438950533788 + - 0.005031438950533787 - - 3 - - 0.015070644907408821 + - 0.005070644907408821 - - 4 - - 0.015125360439090883 + - 0.005125360439090882 - - 5 - - 0.015195413390274502 + - 0.005195413390274502 - - 6 - - 0.015280583348458162 + - 0.005280583348458163 - - 7 - - 0.015380602337443566 + - 0.005380602337443566 - - 8 - - 0.015495155660487904 + - 0.005495155660487905 - - 9 - - 0.015623882890456232 + - 0.0056238828904562315 - - 10 - - 0.015766379003858577 + - 0.0057663790038585796 - - 11 - - 0.0159221956552037 + - 0.005922195655203699 - - 12 - - 0.016090842587659852 + - 0.006090842587659851 - - 13 - - 0.016271789175584174 + - 0.006271789175584172 - - 14 - - 0.01646446609406726 + - 0.006464466094067262 - - 15 - - 0.01666826711023998 + - 0.006668267110239981 - - 16 - - 0.016882550990706333 + - 0.006882550990706332 - - 17 - - 0.017106643519100972 + - 0.007106643519100972 - - 18 - - 0.017339839617423317 + - 0.007339839617423317 - - 19 - - 0.017581405564473802 + - 0.007581405564473801 - - 20 - - 0.01783058130441221 + - 0.007830581304412209 - - 21 - - 0.01808658283817455 + - 0.00808658283817455 - - 22 - - 0.018348604690224164 + - 0.008348604690224165 - - 23 - - 0.018615822442875754 + - 0.008615822442875754 - - 24 - - 0.018887395330218427 + - 0.008887395330218428 - - 25 - - 0.01916246888347632 + - 0.009162468883476318 - - 26 - - 0.01944017761948346 + - 0.00944017761948346 - - 27 - - 0.01971964776381404 + - 0.009719647763814041 - - 28 - - 0.02 + - 0.01 - - 29 - - 0.02028035223618596 + - 0.01028035223618596 - - 30 - - 0.02055982238051654 + - 0.010559822380516538 - - 31 - - 0.020837531116523682 + - 0.010837531116523682 - - 32 - - 0.02111260466978157 + - 0.011112604669781572 - - 33 - - 0.021384177557124247 + - 0.011384177557124247 - - 34 - - 0.021651395309775834 + - 0.011651395309775834 - - 35 - - 0.02191341716182545 + - 0.011913417161825448 - - 36 - - 0.022169418695587792 + - 0.01216941869558779 - - 37 - - 0.0224185944355262 + - 0.0124185944355262 - - 38 - - 0.022660160382576684 + - 0.012660160382576682 - - 39 - - 0.02289335648089903 + - 0.012893356480899029 - - 40 - - 0.023117449009293668 + - 0.013117449009293668 - - 41 - - 0.02333173288976002 + - 0.01333173288976002 - - 42 - - 0.023535533905932736 + - 0.013535533905932737 - - 43 - - 0.023728210824415827 + - 0.013728210824415828 - - 44 - - 0.02390915741234015 + - 0.01390915741234015 - - 45 - - 0.0240778043447963 + - 0.014077804344796302 - - 46 - - 0.02423362099614142 + - 0.014233620996141422 - - 47 - - 0.02437611710954377 + - 0.014376117109543769 - - 48 - - 0.024504844339512097 + - 0.014504844339512095 - - 49 - - 0.024619397662556435 + - 0.014619397662556434 - - 50 - - 0.02471941665154184 + - 0.014719416651541837 - - 51 - - 0.0248045866097255 + - 0.014804586609725497 - - 52 - - 0.024874639560909118 + - 0.014874639560909118 - - 53 - - 0.024929355092591178 + - 0.01492935509259118 - - 54 - - 0.024968561049466213 + - 0.014968561049466214 - - 55 - - 0.024992134075089083 + - 0.014992134075089083 - - 56 - - 0.025 + - 0.015 - - 57 - - 0.024992134075089083 + - 0.014992134075089083 - - 58 - - 0.024968561049466213 + - 0.014968561049466212 - - 59 - - 0.024929355092591178 + - 0.01492935509259118 - - 60 - - 0.024874639560909118 + - 0.014874639560909118 - - 61 - - 0.0248045866097255 + - 0.014804586609725499 - - 62 - - 0.02471941665154184 + - 0.014719416651541837 - - 63 - - 0.024619397662556435 + - 0.014619397662556434 - - 64 - - 0.024504844339512097 + - 0.014504844339512095 - - 65 - - 0.02437611710954377 + - 0.014376117109543767 - - 66 - - 0.024233620996141424 + - 0.014233620996141422 - - 67 - - 0.024077804344796304 + - 0.014077804344796302 - - 68 - - 0.023909157412340152 + - 0.01390915741234015 - - 69 - - 0.02372821082441583 + - 0.013728210824415828 - - 70 - - 0.02353553390593274 + - 0.01353553390593274 - - 71 - - 0.02333173288976002 + - 0.01333173288976002 - - 72 - - 0.023117449009293668 + - 0.01311744900929367 - - 73 - - 0.02289335648089903 + - 0.012893356480899027 - - 74 - - 0.022660160382576684 + - 0.012660160382576684 - - 75 - - 0.022418594435526202 + - 0.012418594435526202 - - 76 - - 0.022169418695587792 + - 0.012169418695587792 - - 77 - - 0.021913417161825453 + - 0.011913417161825451 - - 78 - - 0.021651395309775837 + - 0.011651395309775837 - - 79 - - 0.021384177557124247 + - 0.011384177557124247 - - 80 - - 0.021112604669781574 + - 0.011112604669781574 - - 81 - - 0.020837531116523686 + - 0.010837531116523686 - - 82 - - 0.02055982238051654 + - 0.01055982238051654 - - 83 - - 0.020280352236185958 + - 0.010280352236185957 - - 84 - - 0.02 + - 0.010000000000000002 - - 85 - - 0.019719647763814043 + - 0.009719647763814045 - - 86 - - 0.01944017761948346 + - 0.009440177619483462 - - 87 - - 0.01916246888347632 + - 0.009162468883476316 - - 88 - - 0.01888739533021843 + - 0.008887395330218428 - - 89 - - 0.018615822442875758 + - 0.008615822442875756 - - 90 - - 0.018348604690224167 + - 0.008348604690224165 - - 91 - - 0.01808658283817455 + - 0.00808658283817455 - - 92 - - 0.01783058130441221 + - 0.00783058130441221 - - 93 - - 0.0175814055644738 + - 0.0075814055644738 - - 94 - - 0.01733983961742332 + - 0.007339839617423318 - - 95 - - 0.017106643519100975 + - 0.007106643519100974 - - 96 - - 0.016882550990706333 + - 0.006882550990706333 - - 97 - - 0.01666826711023998 + - 0.006668267110239979 - - 98 - - 0.016464466094067265 + - 0.006464466094067263 - - 99 - - 0.016271789175584174 + - 0.006271789175584174 - - 100 - - 0.016090842587659852 + - 0.006090842587659851 - - 101 - - 0.015922195655203697 + - 0.0059221956552036985 - - 102 - - 0.01576637900385858 + - 0.00576637900385858 - - 103 - - 0.015623882890456233 + - 0.005623882890456233 - - 104 - - 0.015495155660487904 + - 0.005495155660487905 - - 105 - - 0.015380602337443568 + - 0.005380602337443568 - - 106 - - 0.015280583348458162 + - 0.005280583348458163 - - 107 - - 0.015195413390274502 + - 0.005195413390274502 - - 108 - - 0.015125360439090883 + - 0.005125360439090882 - - 109 - - 0.015070644907408821 + - 0.005070644907408821 - - 110 - - 0.015031438950533788 + - 0.005031438950533787 - - 111 - - 0.015007865924910917 + - 0.005007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -245,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.025134751494652507 + noise: 0.013443725935320523 proportion: 0.16 targets: leHavre_fra: - noise: 0.025432733187591285 + noise: 0.030270714085038748 proportion: 0.18755329471737509 montreal_can: - noise: 0.014981815264884504 + noise: 0.013320576022818739 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07860790872534353 + noise: 0.07689493882565487 proportion: 0.47933778254893905 pusan_kor: - noise: 0.002902145091237068 + noise: 0.007972433806655532 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.0016703057083900894 + noise: 0.007497817787595211 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.004329384963154748 + noise: 0.007633866843340292 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.00014700838968303593 + noise: 0.0010106861866602764 proportion: 0.005882857005910926 yantian_chn: - noise: 0.014277274600949947 + noise: 0.012219624836344655 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -283,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003905851406890507 + noise: 0.0019530280872261515 proportion: 0.01 targets: qingdao_chn: - noise: 0.03386602700899302 + noise: 0.0034939030178053614 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04099351916502508 + noise: 0.04233393468254242 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.02983331512414685 + noise: 0.021838198102471493 proportion: 0.24812321657873454 yantian_chn: - noise: 0.0398838857119423 + noise: 0.046242815176850596 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -309,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017049012580563228 + noise: 0.0019129579921117862 proportion: 0.01 targets: qingdao_chn: - noise: 0.006704071585248814 + noise: 0.012228512488579733 proportion: 0.19992517767067194 santos_bra: - noise: 0.01065215665926791 + noise: 0.028078880905400762 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.01889939427623029 + noise: 0.023876351340743802 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.030425501405892584 + noise: 0.029319437252031597 proportion: 0.19775168293424744 yantian_chn: - noise: 0.0038049637706619867 + noise: 0.01928917747193642 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -338,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.010023093144315015 + noise: 0.00350760127602979 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.046713884416130814 + noise: 0.032528716547168546 proportion: 0.2613085269688243 montreal_can: - noise: 0.007011738109808054 + noise: 0.014821251534050164 proportion: 0.09474419644790176 newYork_usa: - noise: 0.0075575968616494 + noise: 0.02447312721184167 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0022204132834372364 + noise: 0.0043063159539580825 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0025163323117031356 + noise: 0.0061997544295394206 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.012253843912920523 + noise: 0.0014225749496497644 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.014556815408633276 + noise: 0.0049886669336311005 proportion: 0.07609945087001035 yantian_chn: - noise: 0.007509358525794673 + noise: 0.010202155612950937 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -376,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007441531984981497 + noise: 0.007116233975121642 proportion: 0.05 targets: oakland_usa: - noise: 0.04265188459544233 + noise: 0.021750420577675664 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.00273897680516611 + noise: 0.007223156875444034 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.01517255937598155 + noise: 0.008409198610215574 proportion: 0.1623492157793647 seattle_usa: - noise: 0.014299850500812094 + noise: 0.04468140938124822 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.0051011672478115 + noise: 0.022579209428659604 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -405,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.005425915310841583 + noise: 0.001237859415806274 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0073296927183103605 + noise: 0.004468190881652269 proportion: 0.1642819028757581 pusan_kor: - noise: 0.018169915140256784 + noise: 0.015630343651636142 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.02383787277319661 + noise: 0.01705599320218467 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.0025563544317216205 + noise: 0.002949720393204809 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.02058384394808081 + noise: 0.0062556847598889565 proportion: 0.11985637174894495 yantian_chn: - noise: 0.00989286132515691 + noise: 0.017417960137127892 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.0007488162438248653 + noise: 0.027064881430223564 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -440,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029979553756433923 + noise: 0.0022241630073084333 proportion: 0.015 targets: singapore_sgp: - noise: 0.0566906410775888 + noise: 0.04113598506120082 proportion: 0.3293364398135728 sydney_aus: - noise: 0.01865388192132147 + noise: 0.05585356106243802 proportion: 0.3364188275147848 yantian_chn: - noise: 0.014238633997660635 + noise: 0.04970952158933521 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -463,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0005621554647653919 + noise: 0.0023396017313775798 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08779643369212999 + noise: 0.029006641730691472 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.07842477295179612 + noise: 0.052743138595601397 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -483,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00016057717079772171 + noise: 0.0029698121952597563 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.05981761122488196 + noise: 0.002300273308223476 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.03990533991720246 + noise: 0.026329645545883667 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -503,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.004910915544061917 + noise: 0.00034658625196087867 proportion: 0.03 targets: losAngeles_usa: - noise: 0.048963812038470556 + noise: 0.03805042564171647 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.0254961817963097 + noise: 0.026783528316198884 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03349874892050399 + noise: 0.02520719401293405 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.012993114869682515 + noise: 0.011450474320078908 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -529,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027667472862969076 + noise: 0.0027574439469690735 proportion: 0.015 targets: losAngeles_usa: - noise: 0.05091486367601389 + noise: 0.030666144891490648 proportion: 0.2657898185062753 oakland_usa: - noise: 0.028397329439457514 + noise: 0.05069695864471698 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.0016646658939369785 + noise: 1.5150697900596916e-05 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.013742472852754001 + noise: 0.005507254948856576 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -555,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.009320427377742116 + noise: 0.003886006717160586 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.031991420231325084 + noise: 0.027386818215617247 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.005105457599858164 + noise: 0.011340855749132506 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.005809147275802185 + noise: 0.0015411008699796073 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0033945457967072133 + noise: 0.0011819920685648456 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.001854192137165468 + noise: 0.005415688613917366 proportion: 0.035795894860646466 seattle_usa: - noise: 0.018330317944630015 + noise: 0.012679066272107449 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.009459052846765289 + noise: 0.004046325432066565 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0016197423680226325 + noise: 0.004754201755016008 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00469787131269142 + noise: 0.010845469930487786 proportion: 0.059258114284493034 yantian_chn: - noise: 0.003856257701007031 + noise: 0.009847287555290789 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.014803870326138143 + noise: 0.016857865956875252 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -602,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.007181454765417904 + noise: 0.0013405281331279736 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02952708760272511 + noise: 0.017720647298623885 proportion: 0.19166868266386958 durban_sau: - noise: 0.0026860007722877676 + noise: 0.004430489262425184 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0023058721270403397 + noise: 0.0029551319318284 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.008262798336030506 + noise: 0.00884618941305856 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.014599621251693524 + noise: 0.008287055306659491 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.004578888771735588 + noise: 0.010416910937371144 proportion: 0.061252276599797005 oakland_usa: - noise: 0.0018968128853613635 + noise: 0.030726016025509867 proportion: 0.15590868899027802 princeRupert_can: - noise: 7.825075850514062e-05 + noise: 0.001029469211236195 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0007151691535729856 + noise: 0.00253441394213481 proportion: 0.018577689927305203 santos_bra: - noise: 0.0036806154087330586 + noise: 0.0012007740198499907 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0016116464454415448 + noise: 0.015740512852146334 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0011503058311188963 + noise: 0.001828465916657425 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0031091344585237185 + noise: 0.000962793819981486 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0017512950798533396 + noise: 0.001870686969127809 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.023837737047619264 + noise: 0.020726812866609105 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -661,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0015229565945744795 + noise: 0.00046662157321829305 proportion: 0.01 targets: manzanillo_mex: - noise: 0.029864110340333205 + noise: 0.0335790014316909 proportion: 0.1695702560614863 pusan_kor: - noise: 0.030434021872288986 + noise: 0.019876836766735944 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.031654173870326326 + noise: 0.021055304334577304 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.022840905205567065 + noise: 0.010351683215713024 proportion: 0.16105317774270345 yantian_chn: - noise: 0.022058626605590343 + noise: 0.020655951601841832 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.020882193597463152 + noise: 0.009059407942596073 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -693,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017591918390130468 + noise: 0.0003480997833509656 proportion: 0.01 targets: itagual_bra: - noise: 0.00015677478442405662 + noise: 0.020657961926928516 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.007951708444894913 + noise: 0.013072578761377065 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.008394529742993468 + noise: 0.027172218926956353 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01406059678653582 + noise: 0.028255176146783356 proportion: 0.19775168256638195 yantian_chn: - noise: 0.011310434190498734 + noise: 0.02522960406069968 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -722,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.009178972285261822 + noise: 0.0007339846715492771 proportion: 0.07 targets: losAngeles_usa: - noise: 0.023523817623575388 + noise: 0.005803300102787883 proportion: 0.2912736754142012 pusan_kor: - noise: 0.01876947062956955 + noise: 0.011767093399526167 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.02029673306956859 + noise: 0.01342850609637382 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.011329185762784782 + noise: 0.02208223845904732 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.00024014816912197655 + noise: 0.01317084017907106 proportion: 0.09977785851511455 vancouver_can: - noise: 0.02057342705041732 + noise: 0.0032415669173149184 proportion: 0.1273542861551621 yantian_chn: - noise: 0.020083358186626803 + noise: 0.01697269521746073 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -757,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017109626305467616 + noise: 0.014530243985042664 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.021959106592952006 + noise: 0.02131285237332896 proportion: 0.21398371679064213 durban_sau: - noise: 0.00010435314516980227 + noise: 0.002948998809093681 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0020594969751376174 + noise: 0.001713993122608175 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009873199353313093 + noise: 0.0009800848688656188 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.014743978442771179 + noise: 0.0050873385069792705 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.0012374290703743276 + noise: 0.004983219928480878 proportion: 0.05976808154382374 oakland_usa: - noise: 0.022426459611386496 + noise: 0.021596249916838263 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0005070099495173756 + noise: 0.0014764151425764754 proportion: 0.00930596400725694 qingdao_chn: - noise: 1.8783239577936313e-05 + noise: 2.741759926803036e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0012407696401487867 + noise: 0.0003052926172722117 proportion: 0.011430536346128936 seattle_usa: - noise: 0.011299147787220907 + noise: 0.01952308695587358 proportion: 0.12100465463531186 vancouver_can: - noise: 0.002147321460772641 + noise: 0.0019949337867570943 proportion: 0.011092475826618629 yantian_chn: - noise: 0.000883163479902347 + noise: 0.0005520948508266831 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.012495339718107597 + noise: 0.015187739134572683 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -813,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0014198451145378962 + noise: 0.005693120029153821 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02403294164090424 + noise: 0.020122388762735893 proportion: 0.16163465526933787 durban_sau: - noise: 0.007339857249890276 + noise: 0.0019491514734383516 proportion: 0.052947229587582224 itagual_bra: - noise: 0.004826948332878951 + noise: 0.0002586292721110565 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.000697323478201817 + noise: 0.004984389187243039 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.009748446374379698 + noise: 0.0015861611856993322 proportion: 0.054598902525719965 pusan_kor: - noise: 0.0052864459821632135 + noise: 0.006025000972759821 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.00020264478777542088 + noise: 0.0004286935806667211 proportion: 0.04380756610509279 santos_bra: - noise: 0.0060662606703405855 + noise: 0.003416715058071535 proportion: 0.0496114180206766 seattle_usa: - noise: 0.002184489196293904 + noise: 0.007700381604340727 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.00446890645579302 + noise: 0.003544364668028845 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.0005079804300151535 + noise: 0.002802086921079384 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0032814259751614335 + noise: 0.010185014617976348 proportion: 0.053961624659387086 vancouver_can: - noise: 0.0013725415556900408 + noise: 0.002789491330076127 proportion: 0.04942443509903704 yantian_chn: - noise: 0.007866049277209214 + noise: 0.005000384119150195 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.013995694253814077 + noise: 0.008577499395403343 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -872,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 5.318259543305715e-05 + noise: 0.002150752663893203 proportion: 0.015 targets: melbourne_aus: - noise: 0.010959524006592607 + noise: 0.05922344082123652 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.013378806626384264 + noise: 0.05193975256137971 proportion: 0.3291642505650358 yantian_chn: - noise: 0.043398566324619615 + noise: 0.061788693147246415 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -895,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002260078974868654 + noise: 0.002068294648050253 proportion: 0.02 targets: pusan_kor: - noise: 0.01022517907397126 + noise: 0.016845200307234364 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.025111111836521687 + noise: 0.014999981061310954 proportion: 0.16078294599848347 seattle_usa: - noise: 0.025666860266381805 + noise: 0.01896644075283542 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.00391575019491024 + noise: 0.0077549932712456865 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009869415376296499 + noise: 0.02055123864749911 proportion: 0.15641751563334233 yantian_chn: - noise: 0.01646828787230074 + noise: 0.03050803433828264 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -927,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.005460106707641842 + noise: 0.002609757843993272 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.03183934815230198 + noise: 0.025222997739158936 proportion: 0.23063506921338092 durban_sau: - noise: 0.006955761417407662 + noise: 0.0018608540738386267 proportion: 0.036977112629701755 itagual_bra: - noise: 0.003879986047538319 + noise: 0.004923606222292092 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.0033746270986396783 + noise: 0.012389321950936184 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.014297914647911386 + noise: 0.003548726911160303 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.0055998037357593185 + noise: 0.000882486825036804 proportion: 0.03992004007199072 pusan_kor: - noise: 0.004337884540903886 + noise: 0.0005349297708399651 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0034845335834618927 + noise: 0.0007216029643777133 proportion: 0.020692152164438926 santos_bra: - noise: 0.0023084677027446535 + noise: 0.0008948241044821844 proportion: 0.03103337095193521 seattle_usa: - noise: 0.0043141199296154705 + noise: 0.006808164648780424 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0001996474876791818 + noise: 0.0019668709850992473 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0011502086812016938 + noise: 0.0008244631028521047 proportion: 0.006007386215135132 sydney_aus: - noise: 0.0019319056238978993 + noise: 0.003274678869997879 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0007858696914021227 + noise: 0.0003213862877618055 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0016168667042640794 + noise: 0.0026076979418575303 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.023246811699828965 + noise: 0.026806722998433646 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -989,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.014254332625813097 + noise: 0.011506949353344573 proportion: 0.08 targets: manzanillo_mex: - noise: 0.03244047063421112 + noise: 0.042678902760188174 proportion: 0.224773870587767 pusan_kor: - noise: 0.018126081484701975 + noise: 0.02092931566180752 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.017152304680050526 + noise: 0.012790853044052902 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.0003086488347039955 + noise: 0.00713764692173517 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0056287128415065625 + noise: 0.018867879170398616 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.019438990767313084 + noise: 0.014299288167726593 proportion: 0.1115894561579222 yantian_chn: - noise: 0.014838419143613479 + noise: 0.010558592890221315 proportion: 0.14697441091807414 routes: a3s: @@ -1163,13 +1159,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 522 + capacity: 290 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 580 + capacity: 290 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 360 + capacity: 164 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 296 + capacity: 164 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 3455 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 3800 + capacity: 1727 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 620 + capacity: 344 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 688 + capacity: 344 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 933 + capacity: 424 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 765 + capacity: 424 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 3962 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4358 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 3566 + capacity: 1981 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 2953 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3248 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 2658 + capacity: 1476 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1466 + capacity: 733 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1612 + capacity: 733 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1320 + capacity: 733 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1277 + capacity: 638 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1404 + capacity: 638 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1150 + capacity: 638 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 485 + capacity: 269 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 538 + capacity: 269 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 591 + capacity: 269 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 388 + capacity: 194 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 426 + capacity: 194 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 350 + capacity: 194 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 711 + capacity: 355 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 782 + capacity: 355 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 640 + capacity: 355 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 3799 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4178 + capacity: 1899 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 3420 + capacity: 1899 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml index 79844f0c4..8b4a802a9 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml @@ -1,234 +1,230 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.015 + - 0.005 - - 1 - - 0.015007865924910917 + - 0.005007865924910917 - - 2 - - 0.015031438950533788 + - 0.005031438950533787 - - 3 - - 0.015070644907408821 + - 0.005070644907408821 - - 4 - - 0.015125360439090883 + - 0.005125360439090882 - - 5 - - 0.015195413390274502 + - 0.005195413390274502 - - 6 - - 0.015280583348458162 + - 0.005280583348458163 - - 7 - - 0.015380602337443566 + - 0.005380602337443566 - - 8 - - 0.015495155660487904 + - 0.005495155660487905 - - 9 - - 0.015623882890456232 + - 0.0056238828904562315 - - 10 - - 0.015766379003858577 + - 0.0057663790038585796 - - 11 - - 0.0159221956552037 + - 0.005922195655203699 - - 12 - - 0.016090842587659852 + - 0.006090842587659851 - - 13 - - 0.016271789175584174 + - 0.006271789175584172 - - 14 - - 0.01646446609406726 + - 0.006464466094067262 - - 15 - - 0.01666826711023998 + - 0.006668267110239981 - - 16 - - 0.016882550990706333 + - 0.006882550990706332 - - 17 - - 0.017106643519100972 + - 0.007106643519100972 - - 18 - - 0.017339839617423317 + - 0.007339839617423317 - - 19 - - 0.017581405564473802 + - 0.007581405564473801 - - 20 - - 0.01783058130441221 + - 0.007830581304412209 - - 21 - - 0.01808658283817455 + - 0.00808658283817455 - - 22 - - 0.018348604690224164 + - 0.008348604690224165 - - 23 - - 0.018615822442875754 + - 0.008615822442875754 - - 24 - - 0.018887395330218427 + - 0.008887395330218428 - - 25 - - 0.01916246888347632 + - 0.009162468883476318 - - 26 - - 0.01944017761948346 + - 0.00944017761948346 - - 27 - - 0.01971964776381404 + - 0.009719647763814041 - - 28 - - 0.02 + - 0.01 - - 29 - - 0.02028035223618596 + - 0.01028035223618596 - - 30 - - 0.02055982238051654 + - 0.010559822380516538 - - 31 - - 0.020837531116523682 + - 0.010837531116523682 - - 32 - - 0.02111260466978157 + - 0.011112604669781572 - - 33 - - 0.021384177557124247 + - 0.011384177557124247 - - 34 - - 0.021651395309775834 + - 0.011651395309775834 - - 35 - - 0.02191341716182545 + - 0.011913417161825448 - - 36 - - 0.022169418695587792 + - 0.01216941869558779 - - 37 - - 0.0224185944355262 + - 0.0124185944355262 - - 38 - - 0.022660160382576684 + - 0.012660160382576682 - - 39 - - 0.02289335648089903 + - 0.012893356480899029 - - 40 - - 0.023117449009293668 + - 0.013117449009293668 - - 41 - - 0.02333173288976002 + - 0.01333173288976002 - - 42 - - 0.023535533905932736 + - 0.013535533905932737 - - 43 - - 0.023728210824415827 + - 0.013728210824415828 - - 44 - - 0.02390915741234015 + - 0.01390915741234015 - - 45 - - 0.0240778043447963 + - 0.014077804344796302 - - 46 - - 0.02423362099614142 + - 0.014233620996141422 - - 47 - - 0.02437611710954377 + - 0.014376117109543769 - - 48 - - 0.024504844339512097 + - 0.014504844339512095 - - 49 - - 0.024619397662556435 + - 0.014619397662556434 - - 50 - - 0.02471941665154184 + - 0.014719416651541837 - - 51 - - 0.0248045866097255 + - 0.014804586609725497 - - 52 - - 0.024874639560909118 + - 0.014874639560909118 - - 53 - - 0.024929355092591178 + - 0.01492935509259118 - - 54 - - 0.024968561049466213 + - 0.014968561049466214 - - 55 - - 0.024992134075089083 + - 0.014992134075089083 - - 56 - - 0.025 + - 0.015 - - 57 - - 0.024992134075089083 + - 0.014992134075089083 - - 58 - - 0.024968561049466213 + - 0.014968561049466212 - - 59 - - 0.024929355092591178 + - 0.01492935509259118 - - 60 - - 0.024874639560909118 + - 0.014874639560909118 - - 61 - - 0.0248045866097255 + - 0.014804586609725499 - - 62 - - 0.02471941665154184 + - 0.014719416651541837 - - 63 - - 0.024619397662556435 + - 0.014619397662556434 - - 64 - - 0.024504844339512097 + - 0.014504844339512095 - - 65 - - 0.02437611710954377 + - 0.014376117109543767 - - 66 - - 0.024233620996141424 + - 0.014233620996141422 - - 67 - - 0.024077804344796304 + - 0.014077804344796302 - - 68 - - 0.023909157412340152 + - 0.01390915741234015 - - 69 - - 0.02372821082441583 + - 0.013728210824415828 - - 70 - - 0.02353553390593274 + - 0.01353553390593274 - - 71 - - 0.02333173288976002 + - 0.01333173288976002 - - 72 - - 0.023117449009293668 + - 0.01311744900929367 - - 73 - - 0.02289335648089903 + - 0.012893356480899027 - - 74 - - 0.022660160382576684 + - 0.012660160382576684 - - 75 - - 0.022418594435526202 + - 0.012418594435526202 - - 76 - - 0.022169418695587792 + - 0.012169418695587792 - - 77 - - 0.021913417161825453 + - 0.011913417161825451 - - 78 - - 0.021651395309775837 + - 0.011651395309775837 - - 79 - - 0.021384177557124247 + - 0.011384177557124247 - - 80 - - 0.021112604669781574 + - 0.011112604669781574 - - 81 - - 0.020837531116523686 + - 0.010837531116523686 - - 82 - - 0.02055982238051654 + - 0.01055982238051654 - - 83 - - 0.020280352236185958 + - 0.010280352236185957 - - 84 - - 0.02 + - 0.010000000000000002 - - 85 - - 0.019719647763814043 + - 0.009719647763814045 - - 86 - - 0.01944017761948346 + - 0.009440177619483462 - - 87 - - 0.01916246888347632 + - 0.009162468883476316 - - 88 - - 0.01888739533021843 + - 0.008887395330218428 - - 89 - - 0.018615822442875758 + - 0.008615822442875756 - - 90 - - 0.018348604690224167 + - 0.008348604690224165 - - 91 - - 0.01808658283817455 + - 0.00808658283817455 - - 92 - - 0.01783058130441221 + - 0.00783058130441221 - - 93 - - 0.0175814055644738 + - 0.0075814055644738 - - 94 - - 0.01733983961742332 + - 0.007339839617423318 - - 95 - - 0.017106643519100975 + - 0.007106643519100974 - - 96 - - 0.016882550990706333 + - 0.006882550990706333 - - 97 - - 0.01666826711023998 + - 0.006668267110239979 - - 98 - - 0.016464466094067265 + - 0.006464466094067263 - - 99 - - 0.016271789175584174 + - 0.006271789175584174 - - 100 - - 0.016090842587659852 + - 0.006090842587659851 - - 101 - - 0.015922195655203697 + - 0.0059221956552036985 - - 102 - - 0.01576637900385858 + - 0.00576637900385858 - - 103 - - 0.015623882890456233 + - 0.005623882890456233 - - 104 - - 0.015495155660487904 + - 0.005495155660487905 - - 105 - - 0.015380602337443568 + - 0.005380602337443568 - - 106 - - 0.015280583348458162 + - 0.005280583348458163 - - 107 - - 0.015195413390274502 + - 0.005195413390274502 - - 108 - - 0.015125360439090883 + - 0.005125360439090882 - - 109 - - 0.015070644907408821 + - 0.005070644907408821 - - 110 - - 0.015031438950533788 + - 0.005031438950533787 - - 111 - - 0.015007865924910917 + - 0.005007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -245,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.025134751494652507 + noise: 0.013443725935320523 proportion: 0.16 targets: leHavre_fra: - noise: 0.025432733187591285 + noise: 0.030270714085038748 proportion: 0.18755329471737509 montreal_can: - noise: 0.014981815264884504 + noise: 0.013320576022818739 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07860790872534353 + noise: 0.07689493882565487 proportion: 0.47933778254893905 pusan_kor: - noise: 0.002902145091237068 + noise: 0.007972433806655532 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.0016703057083900894 + noise: 0.007497817787595211 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.004329384963154748 + noise: 0.007633866843340292 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.00014700838968303593 + noise: 0.0010106861866602764 proportion: 0.005882857005910926 yantian_chn: - noise: 0.014277274600949947 + noise: 0.012219624836344655 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -283,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003905851406890507 + noise: 0.0019530280872261515 proportion: 0.01 targets: qingdao_chn: - noise: 0.03386602700899302 + noise: 0.0034939030178053614 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04099351916502508 + noise: 0.04233393468254242 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.02983331512414685 + noise: 0.021838198102471493 proportion: 0.24812321657873454 yantian_chn: - noise: 0.0398838857119423 + noise: 0.046242815176850596 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -309,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017049012580563228 + noise: 0.0019129579921117862 proportion: 0.01 targets: qingdao_chn: - noise: 0.006704071585248814 + noise: 0.012228512488579733 proportion: 0.19992517767067194 santos_bra: - noise: 0.01065215665926791 + noise: 0.028078880905400762 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.01889939427623029 + noise: 0.023876351340743802 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.030425501405892584 + noise: 0.029319437252031597 proportion: 0.19775168293424744 yantian_chn: - noise: 0.0038049637706619867 + noise: 0.01928917747193642 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -338,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.010023093144315015 + noise: 0.00350760127602979 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.046713884416130814 + noise: 0.032528716547168546 proportion: 0.2613085269688243 montreal_can: - noise: 0.007011738109808054 + noise: 0.014821251534050164 proportion: 0.09474419644790176 newYork_usa: - noise: 0.0075575968616494 + noise: 0.02447312721184167 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0022204132834372364 + noise: 0.0043063159539580825 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0025163323117031356 + noise: 0.0061997544295394206 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.012253843912920523 + noise: 0.0014225749496497644 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.014556815408633276 + noise: 0.0049886669336311005 proportion: 0.07609945087001035 yantian_chn: - noise: 0.007509358525794673 + noise: 0.010202155612950937 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -376,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007441531984981497 + noise: 0.007116233975121642 proportion: 0.05 targets: oakland_usa: - noise: 0.04265188459544233 + noise: 0.021750420577675664 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.00273897680516611 + noise: 0.007223156875444034 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.01517255937598155 + noise: 0.008409198610215574 proportion: 0.1623492157793647 seattle_usa: - noise: 0.014299850500812094 + noise: 0.04468140938124822 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.0051011672478115 + noise: 0.022579209428659604 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -405,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.005425915310841583 + noise: 0.001237859415806274 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0073296927183103605 + noise: 0.004468190881652269 proportion: 0.1642819028757581 pusan_kor: - noise: 0.018169915140256784 + noise: 0.015630343651636142 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.02383787277319661 + noise: 0.01705599320218467 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.0025563544317216205 + noise: 0.002949720393204809 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.02058384394808081 + noise: 0.0062556847598889565 proportion: 0.11985637174894495 yantian_chn: - noise: 0.00989286132515691 + noise: 0.017417960137127892 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.0007488162438248653 + noise: 0.027064881430223564 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -440,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029979553756433923 + noise: 0.0022241630073084333 proportion: 0.015 targets: singapore_sgp: - noise: 0.0566906410775888 + noise: 0.04113598506120082 proportion: 0.3293364398135728 sydney_aus: - noise: 0.01865388192132147 + noise: 0.05585356106243802 proportion: 0.3364188275147848 yantian_chn: - noise: 0.014238633997660635 + noise: 0.04970952158933521 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -463,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0005621554647653919 + noise: 0.0023396017313775798 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08779643369212999 + noise: 0.029006641730691472 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.07842477295179612 + noise: 0.052743138595601397 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -483,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00016057717079772171 + noise: 0.0029698121952597563 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.05981761122488196 + noise: 0.002300273308223476 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.03990533991720246 + noise: 0.026329645545883667 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -503,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.004910915544061917 + noise: 0.00034658625196087867 proportion: 0.03 targets: losAngeles_usa: - noise: 0.048963812038470556 + noise: 0.03805042564171647 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.0254961817963097 + noise: 0.026783528316198884 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03349874892050399 + noise: 0.02520719401293405 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.012993114869682515 + noise: 0.011450474320078908 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -529,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027667472862969076 + noise: 0.0027574439469690735 proportion: 0.015 targets: losAngeles_usa: - noise: 0.05091486367601389 + noise: 0.030666144891490648 proportion: 0.2657898185062753 oakland_usa: - noise: 0.028397329439457514 + noise: 0.05069695864471698 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.0016646658939369785 + noise: 1.5150697900596916e-05 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.013742472852754001 + noise: 0.005507254948856576 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -555,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.009320427377742116 + noise: 0.003886006717160586 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.031991420231325084 + noise: 0.027386818215617247 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.005105457599858164 + noise: 0.011340855749132506 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.005809147275802185 + noise: 0.0015411008699796073 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0033945457967072133 + noise: 0.0011819920685648456 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.001854192137165468 + noise: 0.005415688613917366 proportion: 0.035795894860646466 seattle_usa: - noise: 0.018330317944630015 + noise: 0.012679066272107449 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.009459052846765289 + noise: 0.004046325432066565 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0016197423680226325 + noise: 0.004754201755016008 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00469787131269142 + noise: 0.010845469930487786 proportion: 0.059258114284493034 yantian_chn: - noise: 0.003856257701007031 + noise: 0.009847287555290789 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.014803870326138143 + noise: 0.016857865956875252 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -602,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.007181454765417904 + noise: 0.0013405281331279736 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02952708760272511 + noise: 0.017720647298623885 proportion: 0.19166868266386958 durban_sau: - noise: 0.0026860007722877676 + noise: 0.004430489262425184 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0023058721270403397 + noise: 0.0029551319318284 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.008262798336030506 + noise: 0.00884618941305856 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.014599621251693524 + noise: 0.008287055306659491 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.004578888771735588 + noise: 0.010416910937371144 proportion: 0.061252276599797005 oakland_usa: - noise: 0.0018968128853613635 + noise: 0.030726016025509867 proportion: 0.15590868899027802 princeRupert_can: - noise: 7.825075850514062e-05 + noise: 0.001029469211236195 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0007151691535729856 + noise: 0.00253441394213481 proportion: 0.018577689927305203 santos_bra: - noise: 0.0036806154087330586 + noise: 0.0012007740198499907 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0016116464454415448 + noise: 0.015740512852146334 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0011503058311188963 + noise: 0.001828465916657425 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0031091344585237185 + noise: 0.000962793819981486 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0017512950798533396 + noise: 0.001870686969127809 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.023837737047619264 + noise: 0.020726812866609105 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -661,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0015229565945744795 + noise: 0.00046662157321829305 proportion: 0.01 targets: manzanillo_mex: - noise: 0.029864110340333205 + noise: 0.0335790014316909 proportion: 0.1695702560614863 pusan_kor: - noise: 0.030434021872288986 + noise: 0.019876836766735944 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.031654173870326326 + noise: 0.021055304334577304 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.022840905205567065 + noise: 0.010351683215713024 proportion: 0.16105317774270345 yantian_chn: - noise: 0.022058626605590343 + noise: 0.020655951601841832 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.020882193597463152 + noise: 0.009059407942596073 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -693,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017591918390130468 + noise: 0.0003480997833509656 proportion: 0.01 targets: itagual_bra: - noise: 0.00015677478442405662 + noise: 0.020657961926928516 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.007951708444894913 + noise: 0.013072578761377065 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.008394529742993468 + noise: 0.027172218926956353 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01406059678653582 + noise: 0.028255176146783356 proportion: 0.19775168256638195 yantian_chn: - noise: 0.011310434190498734 + noise: 0.02522960406069968 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -722,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.009178972285261822 + noise: 0.0007339846715492771 proportion: 0.07 targets: losAngeles_usa: - noise: 0.023523817623575388 + noise: 0.005803300102787883 proportion: 0.2912736754142012 pusan_kor: - noise: 0.01876947062956955 + noise: 0.011767093399526167 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.02029673306956859 + noise: 0.01342850609637382 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.011329185762784782 + noise: 0.02208223845904732 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.00024014816912197655 + noise: 0.01317084017907106 proportion: 0.09977785851511455 vancouver_can: - noise: 0.02057342705041732 + noise: 0.0032415669173149184 proportion: 0.1273542861551621 yantian_chn: - noise: 0.020083358186626803 + noise: 0.01697269521746073 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -757,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017109626305467616 + noise: 0.014530243985042664 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.021959106592952006 + noise: 0.02131285237332896 proportion: 0.21398371679064213 durban_sau: - noise: 0.00010435314516980227 + noise: 0.002948998809093681 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0020594969751376174 + noise: 0.001713993122608175 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009873199353313093 + noise: 0.0009800848688656188 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.014743978442771179 + noise: 0.0050873385069792705 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.0012374290703743276 + noise: 0.004983219928480878 proportion: 0.05976808154382374 oakland_usa: - noise: 0.022426459611386496 + noise: 0.021596249916838263 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0005070099495173756 + noise: 0.0014764151425764754 proportion: 0.00930596400725694 qingdao_chn: - noise: 1.8783239577936313e-05 + noise: 2.741759926803036e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0012407696401487867 + noise: 0.0003052926172722117 proportion: 0.011430536346128936 seattle_usa: - noise: 0.011299147787220907 + noise: 0.01952308695587358 proportion: 0.12100465463531186 vancouver_can: - noise: 0.002147321460772641 + noise: 0.0019949337867570943 proportion: 0.011092475826618629 yantian_chn: - noise: 0.000883163479902347 + noise: 0.0005520948508266831 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.012495339718107597 + noise: 0.015187739134572683 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -813,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0014198451145378962 + noise: 0.005693120029153821 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02403294164090424 + noise: 0.020122388762735893 proportion: 0.16163465526933787 durban_sau: - noise: 0.007339857249890276 + noise: 0.0019491514734383516 proportion: 0.052947229587582224 itagual_bra: - noise: 0.004826948332878951 + noise: 0.0002586292721110565 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.000697323478201817 + noise: 0.004984389187243039 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.009748446374379698 + noise: 0.0015861611856993322 proportion: 0.054598902525719965 pusan_kor: - noise: 0.0052864459821632135 + noise: 0.006025000972759821 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.00020264478777542088 + noise: 0.0004286935806667211 proportion: 0.04380756610509279 santos_bra: - noise: 0.0060662606703405855 + noise: 0.003416715058071535 proportion: 0.0496114180206766 seattle_usa: - noise: 0.002184489196293904 + noise: 0.007700381604340727 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.00446890645579302 + noise: 0.003544364668028845 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.0005079804300151535 + noise: 0.002802086921079384 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0032814259751614335 + noise: 0.010185014617976348 proportion: 0.053961624659387086 vancouver_can: - noise: 0.0013725415556900408 + noise: 0.002789491330076127 proportion: 0.04942443509903704 yantian_chn: - noise: 0.007866049277209214 + noise: 0.005000384119150195 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.013995694253814077 + noise: 0.008577499395403343 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -872,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 5.318259543305715e-05 + noise: 0.002150752663893203 proportion: 0.015 targets: melbourne_aus: - noise: 0.010959524006592607 + noise: 0.05922344082123652 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.013378806626384264 + noise: 0.05193975256137971 proportion: 0.3291642505650358 yantian_chn: - noise: 0.043398566324619615 + noise: 0.061788693147246415 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -895,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002260078974868654 + noise: 0.002068294648050253 proportion: 0.02 targets: pusan_kor: - noise: 0.01022517907397126 + noise: 0.016845200307234364 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.025111111836521687 + noise: 0.014999981061310954 proportion: 0.16078294599848347 seattle_usa: - noise: 0.025666860266381805 + noise: 0.01896644075283542 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.00391575019491024 + noise: 0.0077549932712456865 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009869415376296499 + noise: 0.02055123864749911 proportion: 0.15641751563334233 yantian_chn: - noise: 0.01646828787230074 + noise: 0.03050803433828264 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -927,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.005460106707641842 + noise: 0.002609757843993272 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.03183934815230198 + noise: 0.025222997739158936 proportion: 0.23063506921338092 durban_sau: - noise: 0.006955761417407662 + noise: 0.0018608540738386267 proportion: 0.036977112629701755 itagual_bra: - noise: 0.003879986047538319 + noise: 0.004923606222292092 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.0033746270986396783 + noise: 0.012389321950936184 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.014297914647911386 + noise: 0.003548726911160303 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.0055998037357593185 + noise: 0.000882486825036804 proportion: 0.03992004007199072 pusan_kor: - noise: 0.004337884540903886 + noise: 0.0005349297708399651 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0034845335834618927 + noise: 0.0007216029643777133 proportion: 0.020692152164438926 santos_bra: - noise: 0.0023084677027446535 + noise: 0.0008948241044821844 proportion: 0.03103337095193521 seattle_usa: - noise: 0.0043141199296154705 + noise: 0.006808164648780424 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0001996474876791818 + noise: 0.0019668709850992473 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0011502086812016938 + noise: 0.0008244631028521047 proportion: 0.006007386215135132 sydney_aus: - noise: 0.0019319056238978993 + noise: 0.003274678869997879 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0007858696914021227 + noise: 0.0003213862877618055 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0016168667042640794 + noise: 0.0026076979418575303 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.023246811699828965 + noise: 0.026806722998433646 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -989,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.014254332625813097 + noise: 0.011506949353344573 proportion: 0.08 targets: manzanillo_mex: - noise: 0.03244047063421112 + noise: 0.042678902760188174 proportion: 0.224773870587767 pusan_kor: - noise: 0.018126081484701975 + noise: 0.02092931566180752 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.017152304680050526 + noise: 0.012790853044052902 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.0003086488347039955 + noise: 0.00713764692173517 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0056287128415065625 + noise: 0.018867879170398616 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.019438990767313084 + noise: 0.014299288167726593 proportion: 0.1115894561579222 yantian_chn: - noise: 0.014838419143613479 + noise: 0.010558592890221315 proportion: 0.14697441091807414 routes: a3s: @@ -1163,13 +1159,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 696 + capacity: 386 parking: duration: 1 noise: 1 @@ -1180,7 +1180,7 @@ vessels: noise: 1 speed: 10 a3s_vessel_001: - capacity: 773 + capacity: 386 parking: duration: 1 noise: 1 @@ -1191,7 +1191,7 @@ vessels: noise: 1 speed: 10 asa_vessel_000: - capacity: 480 + capacity: 218 parking: duration: 1 noise: 1 @@ -1202,7 +1202,7 @@ vessels: noise: 2 speed: 10 asa_vessel_001: - capacity: 394 + capacity: 218 parking: duration: 1 noise: 1 @@ -1213,7 +1213,7 @@ vessels: noise: 1 speed: 10 ate1_vessel_000: - capacity: 4606 + capacity: 2303 parking: duration: 1 noise: 1 @@ -1224,7 +1224,7 @@ vessels: noise: 2 speed: 10 ate1_vessel_001: - capacity: 5066 + capacity: 2303 parking: duration: 1 noise: 1 @@ -1232,10 +1232,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ate1 sailing: - noise: 2 + noise: 1 speed: 10 gex1_vessel_000: - capacity: 827 + capacity: 459 parking: duration: 1 noise: 1 @@ -1243,10 +1243,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: gex1 sailing: - noise: 2 + noise: 1 speed: 10 gex1_vessel_001: - capacity: 918 + capacity: 459 parking: duration: 1 noise: 1 @@ -1257,7 +1257,7 @@ vessels: noise: 1 speed: 10 ktx5_vessel_000: - capacity: 1245 + capacity: 566 parking: duration: 1 noise: 1 @@ -1268,7 +1268,7 @@ vessels: noise: 1 speed: 10 ktx5_vessel_001: - capacity: 1019 + capacity: 566 parking: duration: 1 noise: 1 @@ -1276,10 +1276,10 @@ vessels: initial_port_name: yokohama_jpn route_name: ktx5 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_000: - capacity: 5283 + capacity: 2641 parking: duration: 1 noise: 1 @@ -1287,10 +1287,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_001: - capacity: 5811 + capacity: 2641 parking: duration: 1 noise: 1 @@ -1298,10 +1298,10 @@ vessels: initial_port_name: yantian_chn route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_002: - capacity: 4755 + capacity: 2641 parking: duration: 1 noise: 1 @@ -1312,7 +1312,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_003: - capacity: 5283 + capacity: 2641 parking: duration: 1 noise: 1 @@ -1320,10 +1320,10 @@ vessels: initial_port_name: leHavre_fra route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_004: - capacity: 5811 + capacity: 2641 parking: duration: 1 noise: 1 @@ -1334,7 +1334,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_005: - capacity: 4755 + capacity: 2641 parking: duration: 1 noise: 1 @@ -1345,7 +1345,7 @@ vessels: noise: 2 speed: 10 pcc1_vessel_000: - capacity: 3938 + capacity: 1969 parking: duration: 1 noise: 1 @@ -1353,10 +1353,10 @@ vessels: initial_port_name: oakland_usa route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 10 pcc1_vessel_001: - capacity: 4331 + capacity: 1969 parking: duration: 1 noise: 1 @@ -1364,10 +1364,10 @@ vessels: initial_port_name: qingdao_chn route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 10 pcc1_vessel_002: - capacity: 3545 + capacity: 1969 parking: duration: 1 noise: 1 @@ -1378,7 +1378,7 @@ vessels: noise: 2 speed: 10 pcc2_vessel_000: - capacity: 1955 + capacity: 977 parking: duration: 1 noise: 1 @@ -1389,7 +1389,7 @@ vessels: noise: 2 speed: 10 pcc2_vessel_001: - capacity: 2150 + capacity: 977 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 10 pcc2_vessel_002: - capacity: 1760 + capacity: 977 parking: duration: 1 noise: 1 @@ -1408,10 +1408,10 @@ vessels: initial_port_name: shanghai_chn route_name: pcc2 sailing: - noise: 1 + noise: 2 speed: 10 pnw1_vessel_000: - capacity: 1703 + capacity: 851 parking: duration: 1 noise: 1 @@ -1422,7 +1422,7 @@ vessels: noise: 1 speed: 10 pnw1_vessel_001: - capacity: 1873 + capacity: 851 parking: duration: 1 noise: 1 @@ -1430,10 +1430,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 10 pnw1_vessel_002: - capacity: 1533 + capacity: 851 parking: duration: 1 noise: 1 @@ -1441,10 +1441,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_000: - capacity: 717 + capacity: 358 parking: duration: 1 noise: 1 @@ -1455,7 +1455,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_001: - capacity: 788 + capacity: 358 parking: duration: 1 noise: 1 @@ -1466,7 +1466,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_002: - capacity: 646 + capacity: 358 parking: duration: 1 noise: 1 @@ -1477,7 +1477,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_003: - capacity: 717 + capacity: 358 parking: duration: 1 noise: 1 @@ -1485,10 +1485,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_004: - capacity: 788 + capacity: 358 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_000: - capacity: 466 + capacity: 258 parking: duration: 1 noise: 1 @@ -1510,7 +1510,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_001: - capacity: 517 + capacity: 258 parking: duration: 1 noise: 1 @@ -1518,10 +1518,10 @@ vessels: initial_port_name: qingdao_chn route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 saf3_vessel_002: - capacity: 568 + capacity: 258 parking: duration: 1 noise: 1 @@ -1532,7 +1532,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_003: - capacity: 466 + capacity: 258 parking: duration: 1 noise: 1 @@ -1543,7 +1543,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_000: - capacity: 948 + capacity: 474 parking: duration: 1 noise: 1 @@ -1554,7 +1554,7 @@ vessels: noise: 2 speed: 10 tla2_vessel_001: - capacity: 1042 + capacity: 474 parking: duration: 1 noise: 1 @@ -1562,10 +1562,10 @@ vessels: initial_port_name: santos_bra route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_002: - capacity: 854 + capacity: 474 parking: duration: 1 noise: 1 @@ -1573,10 +1573,10 @@ vessels: initial_port_name: singapore_sgp route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_003: - capacity: 948 + capacity: 474 parking: duration: 1 noise: 1 @@ -1587,7 +1587,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_004: - capacity: 1042 + capacity: 474 parking: duration: 1 noise: 1 @@ -1598,7 +1598,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_005: - capacity: 854 + capacity: 474 parking: duration: 1 noise: 1 @@ -1606,10 +1606,10 @@ vessels: initial_port_name: yantian_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tlp1_vessel_000: - capacity: 5066 + capacity: 2533 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_001: - capacity: 5572 + capacity: 2533 parking: duration: 1 noise: 1 @@ -1628,10 +1628,10 @@ vessels: initial_port_name: manzanillo_mex route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 10 tlp1_vessel_002: - capacity: 4560 + capacity: 2533 parking: duration: 1 noise: 1 @@ -1639,10 +1639,10 @@ vessels: initial_port_name: pusan_kor route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 10 tlp1_vessel_003: - capacity: 5066 + capacity: 2533 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_004: - capacity: 5572 + capacity: 2533 parking: duration: 1 noise: 1 @@ -1664,7 +1664,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_005: - capacity: 4560 + capacity: 2533 parking: duration: 1 noise: 1 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml index 95c1a90ce..615a54bd2 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml @@ -1,234 +1,230 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.015 + - 0.005 - - 1 - - 0.015007865924910917 + - 0.005007865924910917 - - 2 - - 0.015031438950533788 + - 0.005031438950533787 - - 3 - - 0.015070644907408821 + - 0.005070644907408821 - - 4 - - 0.015125360439090883 + - 0.005125360439090882 - - 5 - - 0.015195413390274502 + - 0.005195413390274502 - - 6 - - 0.015280583348458162 + - 0.005280583348458163 - - 7 - - 0.015380602337443566 + - 0.005380602337443566 - - 8 - - 0.015495155660487904 + - 0.005495155660487905 - - 9 - - 0.015623882890456232 + - 0.0056238828904562315 - - 10 - - 0.015766379003858577 + - 0.0057663790038585796 - - 11 - - 0.0159221956552037 + - 0.005922195655203699 - - 12 - - 0.016090842587659852 + - 0.006090842587659851 - - 13 - - 0.016271789175584174 + - 0.006271789175584172 - - 14 - - 0.01646446609406726 + - 0.006464466094067262 - - 15 - - 0.01666826711023998 + - 0.006668267110239981 - - 16 - - 0.016882550990706333 + - 0.006882550990706332 - - 17 - - 0.017106643519100972 + - 0.007106643519100972 - - 18 - - 0.017339839617423317 + - 0.007339839617423317 - - 19 - - 0.017581405564473802 + - 0.007581405564473801 - - 20 - - 0.01783058130441221 + - 0.007830581304412209 - - 21 - - 0.01808658283817455 + - 0.00808658283817455 - - 22 - - 0.018348604690224164 + - 0.008348604690224165 - - 23 - - 0.018615822442875754 + - 0.008615822442875754 - - 24 - - 0.018887395330218427 + - 0.008887395330218428 - - 25 - - 0.01916246888347632 + - 0.009162468883476318 - - 26 - - 0.01944017761948346 + - 0.00944017761948346 - - 27 - - 0.01971964776381404 + - 0.009719647763814041 - - 28 - - 0.02 + - 0.01 - - 29 - - 0.02028035223618596 + - 0.01028035223618596 - - 30 - - 0.02055982238051654 + - 0.010559822380516538 - - 31 - - 0.020837531116523682 + - 0.010837531116523682 - - 32 - - 0.02111260466978157 + - 0.011112604669781572 - - 33 - - 0.021384177557124247 + - 0.011384177557124247 - - 34 - - 0.021651395309775834 + - 0.011651395309775834 - - 35 - - 0.02191341716182545 + - 0.011913417161825448 - - 36 - - 0.022169418695587792 + - 0.01216941869558779 - - 37 - - 0.0224185944355262 + - 0.0124185944355262 - - 38 - - 0.022660160382576684 + - 0.012660160382576682 - - 39 - - 0.02289335648089903 + - 0.012893356480899029 - - 40 - - 0.023117449009293668 + - 0.013117449009293668 - - 41 - - 0.02333173288976002 + - 0.01333173288976002 - - 42 - - 0.023535533905932736 + - 0.013535533905932737 - - 43 - - 0.023728210824415827 + - 0.013728210824415828 - - 44 - - 0.02390915741234015 + - 0.01390915741234015 - - 45 - - 0.0240778043447963 + - 0.014077804344796302 - - 46 - - 0.02423362099614142 + - 0.014233620996141422 - - 47 - - 0.02437611710954377 + - 0.014376117109543769 - - 48 - - 0.024504844339512097 + - 0.014504844339512095 - - 49 - - 0.024619397662556435 + - 0.014619397662556434 - - 50 - - 0.02471941665154184 + - 0.014719416651541837 - - 51 - - 0.0248045866097255 + - 0.014804586609725497 - - 52 - - 0.024874639560909118 + - 0.014874639560909118 - - 53 - - 0.024929355092591178 + - 0.01492935509259118 - - 54 - - 0.024968561049466213 + - 0.014968561049466214 - - 55 - - 0.024992134075089083 + - 0.014992134075089083 - - 56 - - 0.025 + - 0.015 - - 57 - - 0.024992134075089083 + - 0.014992134075089083 - - 58 - - 0.024968561049466213 + - 0.014968561049466212 - - 59 - - 0.024929355092591178 + - 0.01492935509259118 - - 60 - - 0.024874639560909118 + - 0.014874639560909118 - - 61 - - 0.0248045866097255 + - 0.014804586609725499 - - 62 - - 0.02471941665154184 + - 0.014719416651541837 - - 63 - - 0.024619397662556435 + - 0.014619397662556434 - - 64 - - 0.024504844339512097 + - 0.014504844339512095 - - 65 - - 0.02437611710954377 + - 0.014376117109543767 - - 66 - - 0.024233620996141424 + - 0.014233620996141422 - - 67 - - 0.024077804344796304 + - 0.014077804344796302 - - 68 - - 0.023909157412340152 + - 0.01390915741234015 - - 69 - - 0.02372821082441583 + - 0.013728210824415828 - - 70 - - 0.02353553390593274 + - 0.01353553390593274 - - 71 - - 0.02333173288976002 + - 0.01333173288976002 - - 72 - - 0.023117449009293668 + - 0.01311744900929367 - - 73 - - 0.02289335648089903 + - 0.012893356480899027 - - 74 - - 0.022660160382576684 + - 0.012660160382576684 - - 75 - - 0.022418594435526202 + - 0.012418594435526202 - - 76 - - 0.022169418695587792 + - 0.012169418695587792 - - 77 - - 0.021913417161825453 + - 0.011913417161825451 - - 78 - - 0.021651395309775837 + - 0.011651395309775837 - - 79 - - 0.021384177557124247 + - 0.011384177557124247 - - 80 - - 0.021112604669781574 + - 0.011112604669781574 - - 81 - - 0.020837531116523686 + - 0.010837531116523686 - - 82 - - 0.02055982238051654 + - 0.01055982238051654 - - 83 - - 0.020280352236185958 + - 0.010280352236185957 - - 84 - - 0.02 + - 0.010000000000000002 - - 85 - - 0.019719647763814043 + - 0.009719647763814045 - - 86 - - 0.01944017761948346 + - 0.009440177619483462 - - 87 - - 0.01916246888347632 + - 0.009162468883476316 - - 88 - - 0.01888739533021843 + - 0.008887395330218428 - - 89 - - 0.018615822442875758 + - 0.008615822442875756 - - 90 - - 0.018348604690224167 + - 0.008348604690224165 - - 91 - - 0.01808658283817455 + - 0.00808658283817455 - - 92 - - 0.01783058130441221 + - 0.00783058130441221 - - 93 - - 0.0175814055644738 + - 0.0075814055644738 - - 94 - - 0.01733983961742332 + - 0.007339839617423318 - - 95 - - 0.017106643519100975 + - 0.007106643519100974 - - 96 - - 0.016882550990706333 + - 0.006882550990706333 - - 97 - - 0.01666826711023998 + - 0.006668267110239979 - - 98 - - 0.016464466094067265 + - 0.006464466094067263 - - 99 - - 0.016271789175584174 + - 0.006271789175584174 - - 100 - - 0.016090842587659852 + - 0.006090842587659851 - - 101 - - 0.015922195655203697 + - 0.0059221956552036985 - - 102 - - 0.01576637900385858 + - 0.00576637900385858 - - 103 - - 0.015623882890456233 + - 0.005623882890456233 - - 104 - - 0.015495155660487904 + - 0.005495155660487905 - - 105 - - 0.015380602337443568 + - 0.005380602337443568 - - 106 - - 0.015280583348458162 + - 0.005280583348458163 - - 107 - - 0.015195413390274502 + - 0.005195413390274502 - - 108 - - 0.015125360439090883 + - 0.005125360439090882 - - 109 - - 0.015070644907408821 + - 0.005070644907408821 - - 110 - - 0.015031438950533788 + - 0.005031438950533787 - - 111 - - 0.015007865924910917 + - 0.005007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -245,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.025134751494652507 + noise: 0.013443725935320523 proportion: 0.16 targets: leHavre_fra: - noise: 0.025432733187591285 + noise: 0.030270714085038748 proportion: 0.18755329471737509 montreal_can: - noise: 0.014981815264884504 + noise: 0.013320576022818739 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07860790872534353 + noise: 0.07689493882565487 proportion: 0.47933778254893905 pusan_kor: - noise: 0.002902145091237068 + noise: 0.007972433806655532 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.0016703057083900894 + noise: 0.007497817787595211 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.004329384963154748 + noise: 0.007633866843340292 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.00014700838968303593 + noise: 0.0010106861866602764 proportion: 0.005882857005910926 yantian_chn: - noise: 0.014277274600949947 + noise: 0.012219624836344655 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -283,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003905851406890507 + noise: 0.0019530280872261515 proportion: 0.01 targets: qingdao_chn: - noise: 0.03386602700899302 + noise: 0.0034939030178053614 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04099351916502508 + noise: 0.04233393468254242 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.02983331512414685 + noise: 0.021838198102471493 proportion: 0.24812321657873454 yantian_chn: - noise: 0.0398838857119423 + noise: 0.046242815176850596 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -309,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017049012580563228 + noise: 0.0019129579921117862 proportion: 0.01 targets: qingdao_chn: - noise: 0.006704071585248814 + noise: 0.012228512488579733 proportion: 0.19992517767067194 santos_bra: - noise: 0.01065215665926791 + noise: 0.028078880905400762 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.01889939427623029 + noise: 0.023876351340743802 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.030425501405892584 + noise: 0.029319437252031597 proportion: 0.19775168293424744 yantian_chn: - noise: 0.0038049637706619867 + noise: 0.01928917747193642 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -338,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.010023093144315015 + noise: 0.00350760127602979 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.046713884416130814 + noise: 0.032528716547168546 proportion: 0.2613085269688243 montreal_can: - noise: 0.007011738109808054 + noise: 0.014821251534050164 proportion: 0.09474419644790176 newYork_usa: - noise: 0.0075575968616494 + noise: 0.02447312721184167 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0022204132834372364 + noise: 0.0043063159539580825 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0025163323117031356 + noise: 0.0061997544295394206 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.012253843912920523 + noise: 0.0014225749496497644 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.014556815408633276 + noise: 0.0049886669336311005 proportion: 0.07609945087001035 yantian_chn: - noise: 0.007509358525794673 + noise: 0.010202155612950937 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -376,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007441531984981497 + noise: 0.007116233975121642 proportion: 0.05 targets: oakland_usa: - noise: 0.04265188459544233 + noise: 0.021750420577675664 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.00273897680516611 + noise: 0.007223156875444034 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.01517255937598155 + noise: 0.008409198610215574 proportion: 0.1623492157793647 seattle_usa: - noise: 0.014299850500812094 + noise: 0.04468140938124822 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.0051011672478115 + noise: 0.022579209428659604 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -405,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.005425915310841583 + noise: 0.001237859415806274 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0073296927183103605 + noise: 0.004468190881652269 proportion: 0.1642819028757581 pusan_kor: - noise: 0.018169915140256784 + noise: 0.015630343651636142 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.02383787277319661 + noise: 0.01705599320218467 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.0025563544317216205 + noise: 0.002949720393204809 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.02058384394808081 + noise: 0.0062556847598889565 proportion: 0.11985637174894495 yantian_chn: - noise: 0.00989286132515691 + noise: 0.017417960137127892 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.0007488162438248653 + noise: 0.027064881430223564 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -440,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029979553756433923 + noise: 0.0022241630073084333 proportion: 0.015 targets: singapore_sgp: - noise: 0.0566906410775888 + noise: 0.04113598506120082 proportion: 0.3293364398135728 sydney_aus: - noise: 0.01865388192132147 + noise: 0.05585356106243802 proportion: 0.3364188275147848 yantian_chn: - noise: 0.014238633997660635 + noise: 0.04970952158933521 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -463,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0005621554647653919 + noise: 0.0023396017313775798 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08779643369212999 + noise: 0.029006641730691472 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.07842477295179612 + noise: 0.052743138595601397 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -483,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00016057717079772171 + noise: 0.0029698121952597563 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.05981761122488196 + noise: 0.002300273308223476 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.03990533991720246 + noise: 0.026329645545883667 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -503,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.004910915544061917 + noise: 0.00034658625196087867 proportion: 0.03 targets: losAngeles_usa: - noise: 0.048963812038470556 + noise: 0.03805042564171647 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.0254961817963097 + noise: 0.026783528316198884 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03349874892050399 + noise: 0.02520719401293405 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.012993114869682515 + noise: 0.011450474320078908 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -529,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027667472862969076 + noise: 0.0027574439469690735 proportion: 0.015 targets: losAngeles_usa: - noise: 0.05091486367601389 + noise: 0.030666144891490648 proportion: 0.2657898185062753 oakland_usa: - noise: 0.028397329439457514 + noise: 0.05069695864471698 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.0016646658939369785 + noise: 1.5150697900596916e-05 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.013742472852754001 + noise: 0.005507254948856576 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -555,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.009320427377742116 + noise: 0.003886006717160586 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.031991420231325084 + noise: 0.027386818215617247 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.005105457599858164 + noise: 0.011340855749132506 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.005809147275802185 + noise: 0.0015411008699796073 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0033945457967072133 + noise: 0.0011819920685648456 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.001854192137165468 + noise: 0.005415688613917366 proportion: 0.035795894860646466 seattle_usa: - noise: 0.018330317944630015 + noise: 0.012679066272107449 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.009459052846765289 + noise: 0.004046325432066565 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0016197423680226325 + noise: 0.004754201755016008 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00469787131269142 + noise: 0.010845469930487786 proportion: 0.059258114284493034 yantian_chn: - noise: 0.003856257701007031 + noise: 0.009847287555290789 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.014803870326138143 + noise: 0.016857865956875252 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -602,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.007181454765417904 + noise: 0.0013405281331279736 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02952708760272511 + noise: 0.017720647298623885 proportion: 0.19166868266386958 durban_sau: - noise: 0.0026860007722877676 + noise: 0.004430489262425184 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0023058721270403397 + noise: 0.0029551319318284 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.008262798336030506 + noise: 0.00884618941305856 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.014599621251693524 + noise: 0.008287055306659491 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.004578888771735588 + noise: 0.010416910937371144 proportion: 0.061252276599797005 oakland_usa: - noise: 0.0018968128853613635 + noise: 0.030726016025509867 proportion: 0.15590868899027802 princeRupert_can: - noise: 7.825075850514062e-05 + noise: 0.001029469211236195 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0007151691535729856 + noise: 0.00253441394213481 proportion: 0.018577689927305203 santos_bra: - noise: 0.0036806154087330586 + noise: 0.0012007740198499907 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0016116464454415448 + noise: 0.015740512852146334 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0011503058311188963 + noise: 0.001828465916657425 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0031091344585237185 + noise: 0.000962793819981486 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0017512950798533396 + noise: 0.001870686969127809 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.023837737047619264 + noise: 0.020726812866609105 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -661,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0015229565945744795 + noise: 0.00046662157321829305 proportion: 0.01 targets: manzanillo_mex: - noise: 0.029864110340333205 + noise: 0.0335790014316909 proportion: 0.1695702560614863 pusan_kor: - noise: 0.030434021872288986 + noise: 0.019876836766735944 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.031654173870326326 + noise: 0.021055304334577304 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.022840905205567065 + noise: 0.010351683215713024 proportion: 0.16105317774270345 yantian_chn: - noise: 0.022058626605590343 + noise: 0.020655951601841832 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.020882193597463152 + noise: 0.009059407942596073 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -693,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017591918390130468 + noise: 0.0003480997833509656 proportion: 0.01 targets: itagual_bra: - noise: 0.00015677478442405662 + noise: 0.020657961926928516 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.007951708444894913 + noise: 0.013072578761377065 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.008394529742993468 + noise: 0.027172218926956353 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01406059678653582 + noise: 0.028255176146783356 proportion: 0.19775168256638195 yantian_chn: - noise: 0.011310434190498734 + noise: 0.02522960406069968 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -722,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.009178972285261822 + noise: 0.0007339846715492771 proportion: 0.07 targets: losAngeles_usa: - noise: 0.023523817623575388 + noise: 0.005803300102787883 proportion: 0.2912736754142012 pusan_kor: - noise: 0.01876947062956955 + noise: 0.011767093399526167 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.02029673306956859 + noise: 0.01342850609637382 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.011329185762784782 + noise: 0.02208223845904732 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.00024014816912197655 + noise: 0.01317084017907106 proportion: 0.09977785851511455 vancouver_can: - noise: 0.02057342705041732 + noise: 0.0032415669173149184 proportion: 0.1273542861551621 yantian_chn: - noise: 0.020083358186626803 + noise: 0.01697269521746073 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -757,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017109626305467616 + noise: 0.014530243985042664 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.021959106592952006 + noise: 0.02131285237332896 proportion: 0.21398371679064213 durban_sau: - noise: 0.00010435314516980227 + noise: 0.002948998809093681 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0020594969751376174 + noise: 0.001713993122608175 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009873199353313093 + noise: 0.0009800848688656188 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.014743978442771179 + noise: 0.0050873385069792705 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.0012374290703743276 + noise: 0.004983219928480878 proportion: 0.05976808154382374 oakland_usa: - noise: 0.022426459611386496 + noise: 0.021596249916838263 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0005070099495173756 + noise: 0.0014764151425764754 proportion: 0.00930596400725694 qingdao_chn: - noise: 1.8783239577936313e-05 + noise: 2.741759926803036e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0012407696401487867 + noise: 0.0003052926172722117 proportion: 0.011430536346128936 seattle_usa: - noise: 0.011299147787220907 + noise: 0.01952308695587358 proportion: 0.12100465463531186 vancouver_can: - noise: 0.002147321460772641 + noise: 0.0019949337867570943 proportion: 0.011092475826618629 yantian_chn: - noise: 0.000883163479902347 + noise: 0.0005520948508266831 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.012495339718107597 + noise: 0.015187739134572683 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -813,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0014198451145378962 + noise: 0.005693120029153821 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02403294164090424 + noise: 0.020122388762735893 proportion: 0.16163465526933787 durban_sau: - noise: 0.007339857249890276 + noise: 0.0019491514734383516 proportion: 0.052947229587582224 itagual_bra: - noise: 0.004826948332878951 + noise: 0.0002586292721110565 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.000697323478201817 + noise: 0.004984389187243039 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.009748446374379698 + noise: 0.0015861611856993322 proportion: 0.054598902525719965 pusan_kor: - noise: 0.0052864459821632135 + noise: 0.006025000972759821 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.00020264478777542088 + noise: 0.0004286935806667211 proportion: 0.04380756610509279 santos_bra: - noise: 0.0060662606703405855 + noise: 0.003416715058071535 proportion: 0.0496114180206766 seattle_usa: - noise: 0.002184489196293904 + noise: 0.007700381604340727 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.00446890645579302 + noise: 0.003544364668028845 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.0005079804300151535 + noise: 0.002802086921079384 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0032814259751614335 + noise: 0.010185014617976348 proportion: 0.053961624659387086 vancouver_can: - noise: 0.0013725415556900408 + noise: 0.002789491330076127 proportion: 0.04942443509903704 yantian_chn: - noise: 0.007866049277209214 + noise: 0.005000384119150195 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.013995694253814077 + noise: 0.008577499395403343 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -872,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 5.318259543305715e-05 + noise: 0.002150752663893203 proportion: 0.015 targets: melbourne_aus: - noise: 0.010959524006592607 + noise: 0.05922344082123652 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.013378806626384264 + noise: 0.05193975256137971 proportion: 0.3291642505650358 yantian_chn: - noise: 0.043398566324619615 + noise: 0.061788693147246415 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -895,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002260078974868654 + noise: 0.002068294648050253 proportion: 0.02 targets: pusan_kor: - noise: 0.01022517907397126 + noise: 0.016845200307234364 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.025111111836521687 + noise: 0.014999981061310954 proportion: 0.16078294599848347 seattle_usa: - noise: 0.025666860266381805 + noise: 0.01896644075283542 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.00391575019491024 + noise: 0.0077549932712456865 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009869415376296499 + noise: 0.02055123864749911 proportion: 0.15641751563334233 yantian_chn: - noise: 0.01646828787230074 + noise: 0.03050803433828264 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -927,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.005460106707641842 + noise: 0.002609757843993272 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.03183934815230198 + noise: 0.025222997739158936 proportion: 0.23063506921338092 durban_sau: - noise: 0.006955761417407662 + noise: 0.0018608540738386267 proportion: 0.036977112629701755 itagual_bra: - noise: 0.003879986047538319 + noise: 0.004923606222292092 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.0033746270986396783 + noise: 0.012389321950936184 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.014297914647911386 + noise: 0.003548726911160303 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.0055998037357593185 + noise: 0.000882486825036804 proportion: 0.03992004007199072 pusan_kor: - noise: 0.004337884540903886 + noise: 0.0005349297708399651 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0034845335834618927 + noise: 0.0007216029643777133 proportion: 0.020692152164438926 santos_bra: - noise: 0.0023084677027446535 + noise: 0.0008948241044821844 proportion: 0.03103337095193521 seattle_usa: - noise: 0.0043141199296154705 + noise: 0.006808164648780424 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0001996474876791818 + noise: 0.0019668709850992473 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0011502086812016938 + noise: 0.0008244631028521047 proportion: 0.006007386215135132 sydney_aus: - noise: 0.0019319056238978993 + noise: 0.003274678869997879 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0007858696914021227 + noise: 0.0003213862877618055 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0016168667042640794 + noise: 0.0026076979418575303 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.023246811699828965 + noise: 0.026806722998433646 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -989,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.014254332625813097 + noise: 0.011506949353344573 proportion: 0.08 targets: manzanillo_mex: - noise: 0.03244047063421112 + noise: 0.042678902760188174 proportion: 0.224773870587767 pusan_kor: - noise: 0.018126081484701975 + noise: 0.02092931566180752 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.017152304680050526 + noise: 0.012790853044052902 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.0003086488347039955 + noise: 0.00713764692173517 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0056287128415065625 + noise: 0.018867879170398616 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.019438990767313084 + noise: 0.014299288167726593 proportion: 0.1115894561579222 yantian_chn: - noise: 0.014838419143613479 + noise: 0.010558592890221315 proportion: 0.14697441091807414 routes: a3s: @@ -1163,13 +1159,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 871 + capacity: 483 parking: duration: 1 noise: 1 @@ -1177,10 +1177,10 @@ vessels: initial_port_name: yantian_chn route_name: a3s sailing: - noise: 2 + noise: 1 speed: 10 a3s_vessel_001: - capacity: 967 + capacity: 483 parking: duration: 1 noise: 1 @@ -1188,10 +1188,10 @@ vessels: initial_port_name: sydney_aus route_name: a3s sailing: - noise: 2 + noise: 1 speed: 9 asa_vessel_000: - capacity: 601 + capacity: 273 parking: duration: 1 noise: 1 @@ -1199,10 +1199,10 @@ vessels: initial_port_name: singapore_sgp route_name: asa sailing: - noise: 1 + noise: 2 speed: 8 asa_vessel_001: - capacity: 493 + capacity: 273 parking: duration: 1 noise: 1 @@ -1210,10 +1210,10 @@ vessels: initial_port_name: melbourne_aus route_name: asa sailing: - noise: 2 + noise: 1 speed: 10 ate1_vessel_000: - capacity: 5758 + capacity: 2879 parking: duration: 1 noise: 1 @@ -1221,10 +1221,10 @@ vessels: initial_port_name: newYork_usa route_name: ate1 sailing: - noise: 1 + noise: 2 speed: 9 ate1_vessel_001: - capacity: 6333 + capacity: 2879 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 8 gex1_vessel_000: - capacity: 1033 + capacity: 573 parking: duration: 1 noise: 1 @@ -1243,10 +1243,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: gex1 sailing: - noise: 2 + noise: 1 speed: 10 gex1_vessel_001: - capacity: 1147 + capacity: 573 parking: duration: 1 noise: 1 @@ -1257,7 +1257,7 @@ vessels: noise: 1 speed: 9 ktx5_vessel_000: - capacity: 1557 + capacity: 708 parking: duration: 1 noise: 1 @@ -1268,7 +1268,7 @@ vessels: noise: 1 speed: 8 ktx5_vessel_001: - capacity: 1275 + capacity: 708 parking: duration: 1 noise: 1 @@ -1276,10 +1276,10 @@ vessels: initial_port_name: yokohama_jpn route_name: ktx5 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_000: - capacity: 6603 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1290,7 +1290,7 @@ vessels: noise: 2 speed: 9 ll4_vessel_001: - capacity: 7263 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_002: - capacity: 5943 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1309,10 +1309,10 @@ vessels: initial_port_name: singapore_sgp route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_003: - capacity: 6603 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 9 ll4_vessel_004: - capacity: 7263 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1331,10 +1331,10 @@ vessels: initial_port_name: pusan_kor route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 8 ll4_vessel_005: - capacity: 5943 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1342,10 +1342,10 @@ vessels: initial_port_name: qingdao_chn route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 pcc1_vessel_000: - capacity: 4922 + capacity: 2461 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 9 pcc1_vessel_001: - capacity: 5414 + capacity: 2461 parking: duration: 1 noise: 1 @@ -1364,10 +1364,10 @@ vessels: initial_port_name: qingdao_chn route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 8 pcc1_vessel_002: - capacity: 4430 + capacity: 2461 parking: duration: 1 noise: 1 @@ -1375,10 +1375,10 @@ vessels: initial_port_name: princeRupert_can route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 10 pcc2_vessel_000: - capacity: 2443 + capacity: 1221 parking: duration: 1 noise: 1 @@ -1389,7 +1389,7 @@ vessels: noise: 2 speed: 9 pcc2_vessel_001: - capacity: 2687 + capacity: 1221 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 8 pcc2_vessel_002: - capacity: 2199 + capacity: 1221 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 2129 + capacity: 1064 parking: duration: 1 noise: 1 @@ -1422,7 +1422,7 @@ vessels: noise: 1 speed: 9 pnw1_vessel_001: - capacity: 2341 + capacity: 1064 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 8 pnw1_vessel_002: - capacity: 1917 + capacity: 1064 parking: duration: 1 noise: 1 @@ -1444,7 +1444,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_000: - capacity: 897 + capacity: 448 parking: duration: 1 noise: 1 @@ -1452,10 +1452,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 9 pnw2_vessel_001: - capacity: 986 + capacity: 448 parking: duration: 1 noise: 1 @@ -1463,10 +1463,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 8 pnw2_vessel_002: - capacity: 808 + capacity: 448 parking: duration: 1 noise: 1 @@ -1477,7 +1477,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_003: - capacity: 897 + capacity: 448 parking: duration: 1 noise: 1 @@ -1488,7 +1488,7 @@ vessels: noise: 1 speed: 9 pnw2_vessel_004: - capacity: 986 + capacity: 448 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 8 saf3_vessel_000: - capacity: 583 + capacity: 323 parking: duration: 1 noise: 1 @@ -1510,7 +1510,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_001: - capacity: 647 + capacity: 323 parking: duration: 1 noise: 1 @@ -1518,10 +1518,10 @@ vessels: initial_port_name: qingdao_chn route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 9 saf3_vessel_002: - capacity: 711 + capacity: 323 parking: duration: 1 noise: 1 @@ -1529,10 +1529,10 @@ vessels: initial_port_name: singapore_sgp route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 8 saf3_vessel_003: - capacity: 583 + capacity: 323 parking: duration: 1 noise: 1 @@ -1540,10 +1540,10 @@ vessels: initial_port_name: durban_sau route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_000: - capacity: 1185 + capacity: 592 parking: duration: 1 noise: 1 @@ -1551,10 +1551,10 @@ vessels: initial_port_name: itagual_bra route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 9 tla2_vessel_001: - capacity: 1303 + capacity: 592 parking: duration: 1 noise: 1 @@ -1562,10 +1562,10 @@ vessels: initial_port_name: santos_bra route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 8 tla2_vessel_002: - capacity: 1067 + capacity: 592 parking: duration: 1 noise: 1 @@ -1573,10 +1573,10 @@ vessels: initial_port_name: singapore_sgp route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_003: - capacity: 1185 + capacity: 592 parking: duration: 1 noise: 1 @@ -1587,7 +1587,7 @@ vessels: noise: 1 speed: 9 tla2_vessel_004: - capacity: 1303 + capacity: 592 parking: duration: 1 noise: 1 @@ -1595,10 +1595,10 @@ vessels: initial_port_name: qingdao_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 8 tla2_vessel_005: - capacity: 1067 + capacity: 592 parking: duration: 1 noise: 1 @@ -1606,10 +1606,10 @@ vessels: initial_port_name: yantian_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tlp1_vessel_000: - capacity: 6332 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_001: - capacity: 6965 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1628,10 +1628,10 @@ vessels: initial_port_name: manzanillo_mex route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 8 tlp1_vessel_002: - capacity: 5699 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 6332 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_004: - capacity: 6965 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1664,7 +1664,7 @@ vessels: noise: 1 speed: 8 tlp1_vessel_005: - capacity: 5699 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1672,5 +1672,5 @@ vessels: initial_port_name: yokohama_jpn route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 10 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml index c38a34d1c..4378bc2d2 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml @@ -1,234 +1,230 @@ -seed: 4096 -transfer_cost_factors: - load: 0.05 - dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.015 + - 0.005 - - 1 - - 0.015012045981107782 + - 0.005012045981107781 - - 2 - - 0.015044493615969741 + - 0.00504449361596974 - - 3 - - 0.015086758870970732 + - 0.005086758870970731 - - 4 - - 0.01512277494153067 + - 0.0051227749415306695 - - 5 - - 0.01513318262505517 + - 0.005133182625055171 - - 6 - - 0.01509807371913584 + - 0.00509807371913584 - - 7 - - 0.015 + - 0.005 - - 8 - - 0.015173074266317171 + - 0.005173074266317172 - - 9 - - 0.015425203006617148 + - 0.005425203006617148 - - 10 - - 0.015750572812854108 + - 0.005750572812854111 - - 11 - - 0.016132546658976815 + - 0.006132546658976814 - - 12 - - 0.01654380252377108 + - 0.006543802523771078 - - 13 - - 0.016947634709925108 + - 0.0069476347099251025 - - 14 - - 0.017300377961276522 + - 0.007300377961276525 - - 15 - - 0.017554806245962416 + - 0.007554806245962416 - - 16 - - 0.01766425880641032 + - 0.00766425880641032 - - 17 - - 0.01758716473640939 + - 0.007587164736409392 - - 18 - - 0.017291581573131123 + - 0.0072915815731311225 - - 19 - - 0.016759338850452894 + - 0.006759338850452894 - - 20 - - 0.015989387422188653 + - 0.005989387422188653 - - 21 - - 0.015000000000000001 + - 0.005000000000000001 - - 22 - - 0.016170454760379226 + - 0.006170454760379227 - - 23 - - 0.017464338416109185 + - 0.0074643384161091845 - - 24 - - 0.01880721970850913 + - 0.008807219708509131 - - 25 - - 0.020111919797577836 + - 0.010111919797577836 - - 26 - - 0.021283910705811104 + - 0.011283910705811102 - - 27 - - 0.02222773080624969 + - 0.012227730806249693 - - 28 - - 0.022853981633974483 + - 0.012853981633974484 - - 29 - - 0.023086401027200568 + - 0.013086401027200566 - - 30 - - 0.022868475176765664 + - 0.012868475176765658 - - 31 - - 0.022169060410756062 + - 0.012169060410756063 - - 32 - - 0.02098653519702863 + - 0.010986535197028633 - - 33 - - 0.01935109142050977 + - 0.009351091420509772 - - 34 - - 0.017324895896556256 + - 0.007324895896556256 - - 35 - - 0.015 + - 0.005000000000000001 - - 36 - - 0.017505963234746832 + - 0.007505963234746832 - - 37 - - 0.02005609098616606 + - 0.01005609098616606 - - 38 - - 0.022502173332406644 + - 0.012502173332406642 - - 39 - - 0.024693815471924507 + - 0.014693815471924509 - - 40 - - 0.02648812707616644 + - 0.016488127076166443 - - 41 - - 0.027759325587487844 + - 0.017759325587487846 - - 42 - - 0.028407585306672437 + - 0.018407585306672438 - - 43 - - 0.028366497123525156 + - 0.018366497123525158 - - 44 - - 0.027608583358805686 + - 0.017608583358805684 - - 45 - - 0.026148433549357086 + - 0.016148433549357088 - - 46 - - 0.024043182092683656 + - 0.014043182092683657 - - 47 - - 0.02139022683000181 + - 0.01139022683000181 - - 48 - - 0.018322276390618314 + - 0.008322276390618315 - - 49 - - 0.015000000000000003 + - 0.005000000000000003 - - 50 - - 0.01839727693779964 + - 0.008397276937799642 - - 51 - - 0.021682247211563782 + - 0.01168224721156378 - - 52 - - 0.024670979964007092 + - 0.014670979964007094 - - 53 - - 0.027194221337363163 + - 0.017194221337363164 - - 54 - - 0.02910789226660702 + - 0.019107892266607023 - - 55 - - 0.030302085852342477 + - 0.02030208585234248 - - 56 - - 0.030707963267948966 + - 0.020707963267948964 - - 57 - - 0.03030208585234248 + - 0.020302085852342482 - - 58 - - 0.029107892266607024 + - 0.019107892266607026 - - 59 - - 0.027194221337363163 + - 0.017194221337363164 - - 60 - - 0.0246709799640071 + - 0.014670979964007097 - - 61 - - 0.021682247211563786 + - 0.011682247211563787 - - 62 - - 0.018397276937799648 + - 0.008397276937799646 - - 63 - - 0.015000000000000001 + - 0.005000000000000001 - - 64 - - 0.01832227639061831 + - 0.008322276390618312 - - 65 - - 0.021390226830001805 + - 0.011390226830001805 - - 66 - - 0.024043182092683656 + - 0.014043182092683654 - - 67 - - 0.026148433549357086 + - 0.016148433549357084 - - 68 - - 0.02760858335880569 + - 0.017608583358805684 - - 69 - - 0.02836649712352516 + - 0.018366497123525158 - - 70 - - 0.028407585306672443 + - 0.018407585306672445 - - 71 - - 0.027759325587487844 + - 0.017759325587487846 - - 72 - - 0.026488127076166445 + - 0.016488127076166446 - - 73 - - 0.024693815471924514 + - 0.014693815471924509 - - 74 - - 0.022502173332406648 + - 0.012502173332406646 - - 75 - - 0.020056090986166064 + - 0.010056090986166066 - - 76 - - 0.017505963234746836 + - 0.007505963234746836 - - 77 - - 0.015000000000000001 + - 0.005000000000000002 - - 78 - - 0.017324895896556256 + - 0.007324895896556256 - - 79 - - 0.019351091420509767 + - 0.009351091420509768 - - 80 - - 0.020986535197028634 + - 0.010986535197028632 - - 81 - - 0.022169060410756065 + - 0.012169060410756065 - - 82 - - 0.02286847517676566 + - 0.012868475176765662 - - 83 - - 0.02308640102720056 + - 0.013086401027200562 - - 84 - - 0.022853981633974483 + - 0.012853981633974484 - - 85 - - 0.022227730806249697 + - 0.0122277308062497 - - 86 - - 0.021283910705811104 + - 0.011283910705811105 - - 87 - - 0.020111919797577836 + - 0.010111919797577834 - - 88 - - 0.018807219708509137 + - 0.008807219708509133 - - 89 - - 0.017464338416109188 + - 0.007464338416109186 - - 90 - - 0.01617045476037923 + - 0.006170454760379228 - - 91 - - 0.015 + - 0.005 - - 92 - - 0.01598938742218865 + - 0.005989387422188652 - - 93 - - 0.01675933885045289 + - 0.006759338850452893 - - 94 - - 0.017291581573131126 + - 0.0072915815731311225 - - 95 - - 0.017587164736409394 + - 0.007587164736409394 - - 96 - - 0.01766425880641032 + - 0.007664258806410321 - - 97 - - 0.017554806245962416 + - 0.0075548062459624135 - - 98 - - 0.01730037796127653 + - 0.007300377961276526 - - 99 - - 0.016947634709925108 + - 0.006947634709925106 - - 100 - - 0.01654380252377108 + - 0.006543802523771078 - - 101 - - 0.01613254665897681 + - 0.006132546658976813 - - 102 - - 0.01575057281285411 + - 0.005750572812854112 - - 103 - - 0.015425203006617148 + - 0.005425203006617149 - - 104 - - 0.015173074266317171 + - 0.005173074266317172 - - 105 - - 0.015 + - 0.005 - - 106 - - 0.01509807371913584 + - 0.005098073719135839 - - 107 - - 0.01513318262505517 + - 0.005133182625055171 - - 108 - - 0.01512277494153067 + - 0.0051227749415306695 - - 109 - - 0.015086758870970732 + - 0.005086758870970731 - - 110 - - 0.015044493615969741 + - 0.00504449361596974 - - 111 - - 0.015012045981107782 + - 0.005012045981107781 sample_noise: 0.002 container_volumes: - 1 @@ -245,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.025134751494652507 + noise: 0.013443725935320523 proportion: 0.16 targets: leHavre_fra: - noise: 0.025432733187591285 + noise: 0.030270714085038748 proportion: 0.18755329471737509 montreal_can: - noise: 0.014981815264884504 + noise: 0.013320576022818739 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07860790872534353 + noise: 0.07689493882565487 proportion: 0.47933778254893905 pusan_kor: - noise: 0.002902145091237068 + noise: 0.007972433806655532 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.0016703057083900894 + noise: 0.007497817787595211 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.004329384963154748 + noise: 0.007633866843340292 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.00014700838968303593 + noise: 0.0010106861866602764 proportion: 0.005882857005910926 yantian_chn: - noise: 0.014277274600949947 + noise: 0.012219624836344655 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -283,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003905851406890507 + noise: 0.0019530280872261515 proportion: 0.01 targets: qingdao_chn: - noise: 0.03386602700899302 + noise: 0.0034939030178053614 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04099351916502508 + noise: 0.04233393468254242 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.02983331512414685 + noise: 0.021838198102471493 proportion: 0.24812321657873454 yantian_chn: - noise: 0.0398838857119423 + noise: 0.046242815176850596 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -309,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017049012580563228 + noise: 0.0019129579921117862 proportion: 0.01 targets: qingdao_chn: - noise: 0.006704071585248814 + noise: 0.012228512488579733 proportion: 0.19992517767067194 santos_bra: - noise: 0.01065215665926791 + noise: 0.028078880905400762 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.01889939427623029 + noise: 0.023876351340743802 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.030425501405892584 + noise: 0.029319437252031597 proportion: 0.19775168293424744 yantian_chn: - noise: 0.0038049637706619867 + noise: 0.01928917747193642 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -338,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.010023093144315015 + noise: 0.00350760127602979 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.046713884416130814 + noise: 0.032528716547168546 proportion: 0.2613085269688243 montreal_can: - noise: 0.007011738109808054 + noise: 0.014821251534050164 proportion: 0.09474419644790176 newYork_usa: - noise: 0.0075575968616494 + noise: 0.02447312721184167 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0022204132834372364 + noise: 0.0043063159539580825 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0025163323117031356 + noise: 0.0061997544295394206 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.012253843912920523 + noise: 0.0014225749496497644 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.014556815408633276 + noise: 0.0049886669336311005 proportion: 0.07609945087001035 yantian_chn: - noise: 0.007509358525794673 + noise: 0.010202155612950937 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -376,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007441531984981497 + noise: 0.007116233975121642 proportion: 0.05 targets: oakland_usa: - noise: 0.04265188459544233 + noise: 0.021750420577675664 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.00273897680516611 + noise: 0.007223156875444034 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.01517255937598155 + noise: 0.008409198610215574 proportion: 0.1623492157793647 seattle_usa: - noise: 0.014299850500812094 + noise: 0.04468140938124822 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.0051011672478115 + noise: 0.022579209428659604 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -405,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.005425915310841583 + noise: 0.001237859415806274 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0073296927183103605 + noise: 0.004468190881652269 proportion: 0.1642819028757581 pusan_kor: - noise: 0.018169915140256784 + noise: 0.015630343651636142 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.02383787277319661 + noise: 0.01705599320218467 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.0025563544317216205 + noise: 0.002949720393204809 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.02058384394808081 + noise: 0.0062556847598889565 proportion: 0.11985637174894495 yantian_chn: - noise: 0.00989286132515691 + noise: 0.017417960137127892 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.0007488162438248653 + noise: 0.027064881430223564 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -440,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029979553756433923 + noise: 0.0022241630073084333 proportion: 0.015 targets: singapore_sgp: - noise: 0.0566906410775888 + noise: 0.04113598506120082 proportion: 0.3293364398135728 sydney_aus: - noise: 0.01865388192132147 + noise: 0.05585356106243802 proportion: 0.3364188275147848 yantian_chn: - noise: 0.014238633997660635 + noise: 0.04970952158933521 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -463,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0005621554647653919 + noise: 0.0023396017313775798 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08779643369212999 + noise: 0.029006641730691472 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.07842477295179612 + noise: 0.052743138595601397 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -483,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00016057717079772171 + noise: 0.0029698121952597563 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.05981761122488196 + noise: 0.002300273308223476 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.03990533991720246 + noise: 0.026329645545883667 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -503,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.004910915544061917 + noise: 0.00034658625196087867 proportion: 0.03 targets: losAngeles_usa: - noise: 0.048963812038470556 + noise: 0.03805042564171647 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.0254961817963097 + noise: 0.026783528316198884 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03349874892050399 + noise: 0.02520719401293405 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.012993114869682515 + noise: 0.011450474320078908 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -529,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027667472862969076 + noise: 0.0027574439469690735 proportion: 0.015 targets: losAngeles_usa: - noise: 0.05091486367601389 + noise: 0.030666144891490648 proportion: 0.2657898185062753 oakland_usa: - noise: 0.028397329439457514 + noise: 0.05069695864471698 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.0016646658939369785 + noise: 1.5150697900596916e-05 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.013742472852754001 + noise: 0.005507254948856576 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -555,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.009320427377742116 + noise: 0.003886006717160586 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.031991420231325084 + noise: 0.027386818215617247 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.005105457599858164 + noise: 0.011340855749132506 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.005809147275802185 + noise: 0.0015411008699796073 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0033945457967072133 + noise: 0.0011819920685648456 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.001854192137165468 + noise: 0.005415688613917366 proportion: 0.035795894860646466 seattle_usa: - noise: 0.018330317944630015 + noise: 0.012679066272107449 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.009459052846765289 + noise: 0.004046325432066565 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0016197423680226325 + noise: 0.004754201755016008 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00469787131269142 + noise: 0.010845469930487786 proportion: 0.059258114284493034 yantian_chn: - noise: 0.003856257701007031 + noise: 0.009847287555290789 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.014803870326138143 + noise: 0.016857865956875252 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -602,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.007181454765417904 + noise: 0.0013405281331279736 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02952708760272511 + noise: 0.017720647298623885 proportion: 0.19166868266386958 durban_sau: - noise: 0.0026860007722877676 + noise: 0.004430489262425184 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0023058721270403397 + noise: 0.0029551319318284 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.008262798336030506 + noise: 0.00884618941305856 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.014599621251693524 + noise: 0.008287055306659491 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.004578888771735588 + noise: 0.010416910937371144 proportion: 0.061252276599797005 oakland_usa: - noise: 0.0018968128853613635 + noise: 0.030726016025509867 proportion: 0.15590868899027802 princeRupert_can: - noise: 7.825075850514062e-05 + noise: 0.001029469211236195 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0007151691535729856 + noise: 0.00253441394213481 proportion: 0.018577689927305203 santos_bra: - noise: 0.0036806154087330586 + noise: 0.0012007740198499907 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0016116464454415448 + noise: 0.015740512852146334 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0011503058311188963 + noise: 0.001828465916657425 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0031091344585237185 + noise: 0.000962793819981486 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0017512950798533396 + noise: 0.001870686969127809 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.023837737047619264 + noise: 0.020726812866609105 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -661,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0015229565945744795 + noise: 0.00046662157321829305 proportion: 0.01 targets: manzanillo_mex: - noise: 0.029864110340333205 + noise: 0.0335790014316909 proportion: 0.1695702560614863 pusan_kor: - noise: 0.030434021872288986 + noise: 0.019876836766735944 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.031654173870326326 + noise: 0.021055304334577304 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.022840905205567065 + noise: 0.010351683215713024 proportion: 0.16105317774270345 yantian_chn: - noise: 0.022058626605590343 + noise: 0.020655951601841832 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.020882193597463152 + noise: 0.009059407942596073 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -693,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0017591918390130468 + noise: 0.0003480997833509656 proportion: 0.01 targets: itagual_bra: - noise: 0.00015677478442405662 + noise: 0.020657961926928516 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.007951708444894913 + noise: 0.013072578761377065 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.008394529742993468 + noise: 0.027172218926956353 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01406059678653582 + noise: 0.028255176146783356 proportion: 0.19775168256638195 yantian_chn: - noise: 0.011310434190498734 + noise: 0.02522960406069968 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -722,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.009178972285261822 + noise: 0.0007339846715492771 proportion: 0.07 targets: losAngeles_usa: - noise: 0.023523817623575388 + noise: 0.005803300102787883 proportion: 0.2912736754142012 pusan_kor: - noise: 0.01876947062956955 + noise: 0.011767093399526167 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.02029673306956859 + noise: 0.01342850609637382 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.011329185762784782 + noise: 0.02208223845904732 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.00024014816912197655 + noise: 0.01317084017907106 proportion: 0.09977785851511455 vancouver_can: - noise: 0.02057342705041732 + noise: 0.0032415669173149184 proportion: 0.1273542861551621 yantian_chn: - noise: 0.020083358186626803 + noise: 0.01697269521746073 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -757,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017109626305467616 + noise: 0.014530243985042664 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.021959106592952006 + noise: 0.02131285237332896 proportion: 0.21398371679064213 durban_sau: - noise: 0.00010435314516980227 + noise: 0.002948998809093681 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0020594969751376174 + noise: 0.001713993122608175 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009873199353313093 + noise: 0.0009800848688656188 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.014743978442771179 + noise: 0.0050873385069792705 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.0012374290703743276 + noise: 0.004983219928480878 proportion: 0.05976808154382374 oakland_usa: - noise: 0.022426459611386496 + noise: 0.021596249916838263 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0005070099495173756 + noise: 0.0014764151425764754 proportion: 0.00930596400725694 qingdao_chn: - noise: 1.8783239577936313e-05 + noise: 2.741759926803036e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0012407696401487867 + noise: 0.0003052926172722117 proportion: 0.011430536346128936 seattle_usa: - noise: 0.011299147787220907 + noise: 0.01952308695587358 proportion: 0.12100465463531186 vancouver_can: - noise: 0.002147321460772641 + noise: 0.0019949337867570943 proportion: 0.011092475826618629 yantian_chn: - noise: 0.000883163479902347 + noise: 0.0005520948508266831 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.012495339718107597 + noise: 0.015187739134572683 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -813,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0014198451145378962 + noise: 0.005693120029153821 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02403294164090424 + noise: 0.020122388762735893 proportion: 0.16163465526933787 durban_sau: - noise: 0.007339857249890276 + noise: 0.0019491514734383516 proportion: 0.052947229587582224 itagual_bra: - noise: 0.004826948332878951 + noise: 0.0002586292721110565 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.000697323478201817 + noise: 0.004984389187243039 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.009748446374379698 + noise: 0.0015861611856993322 proportion: 0.054598902525719965 pusan_kor: - noise: 0.0052864459821632135 + noise: 0.006025000972759821 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.00020264478777542088 + noise: 0.0004286935806667211 proportion: 0.04380756610509279 santos_bra: - noise: 0.0060662606703405855 + noise: 0.003416715058071535 proportion: 0.0496114180206766 seattle_usa: - noise: 0.002184489196293904 + noise: 0.007700381604340727 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.00446890645579302 + noise: 0.003544364668028845 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.0005079804300151535 + noise: 0.002802086921079384 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0032814259751614335 + noise: 0.010185014617976348 proportion: 0.053961624659387086 vancouver_can: - noise: 0.0013725415556900408 + noise: 0.002789491330076127 proportion: 0.04942443509903704 yantian_chn: - noise: 0.007866049277209214 + noise: 0.005000384119150195 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.013995694253814077 + noise: 0.008577499395403343 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -872,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 5.318259543305715e-05 + noise: 0.002150752663893203 proportion: 0.015 targets: melbourne_aus: - noise: 0.010959524006592607 + noise: 0.05922344082123652 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.013378806626384264 + noise: 0.05193975256137971 proportion: 0.3291642505650358 yantian_chn: - noise: 0.043398566324619615 + noise: 0.061788693147246415 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -895,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002260078974868654 + noise: 0.002068294648050253 proportion: 0.02 targets: pusan_kor: - noise: 0.01022517907397126 + noise: 0.016845200307234364 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.025111111836521687 + noise: 0.014999981061310954 proportion: 0.16078294599848347 seattle_usa: - noise: 0.025666860266381805 + noise: 0.01896644075283542 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.00391575019491024 + noise: 0.0077549932712456865 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009869415376296499 + noise: 0.02055123864749911 proportion: 0.15641751563334233 yantian_chn: - noise: 0.01646828787230074 + noise: 0.03050803433828264 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -927,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.005460106707641842 + noise: 0.002609757843993272 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.03183934815230198 + noise: 0.025222997739158936 proportion: 0.23063506921338092 durban_sau: - noise: 0.006955761417407662 + noise: 0.0018608540738386267 proportion: 0.036977112629701755 itagual_bra: - noise: 0.003879986047538319 + noise: 0.004923606222292092 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.0033746270986396783 + noise: 0.012389321950936184 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.014297914647911386 + noise: 0.003548726911160303 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.0055998037357593185 + noise: 0.000882486825036804 proportion: 0.03992004007199072 pusan_kor: - noise: 0.004337884540903886 + noise: 0.0005349297708399651 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0034845335834618927 + noise: 0.0007216029643777133 proportion: 0.020692152164438926 santos_bra: - noise: 0.0023084677027446535 + noise: 0.0008948241044821844 proportion: 0.03103337095193521 seattle_usa: - noise: 0.0043141199296154705 + noise: 0.006808164648780424 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0001996474876791818 + noise: 0.0019668709850992473 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0011502086812016938 + noise: 0.0008244631028521047 proportion: 0.006007386215135132 sydney_aus: - noise: 0.0019319056238978993 + noise: 0.003274678869997879 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0007858696914021227 + noise: 0.0003213862877618055 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0016168667042640794 + noise: 0.0026076979418575303 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.023246811699828965 + noise: 0.026806722998433646 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -989,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.014254332625813097 + noise: 0.011506949353344573 proportion: 0.08 targets: manzanillo_mex: - noise: 0.03244047063421112 + noise: 0.042678902760188174 proportion: 0.224773870587767 pusan_kor: - noise: 0.018126081484701975 + noise: 0.02092931566180752 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.017152304680050526 + noise: 0.012790853044052902 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.0003086488347039955 + noise: 0.00713764692173517 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0056287128415065625 + noise: 0.018867879170398616 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.019438990767313084 + noise: 0.014299288167726593 proportion: 0.1115894561579222 yantian_chn: - noise: 0.014838419143613479 + noise: 0.010558592890221315 proportion: 0.14697441091807414 routes: a3s: @@ -1163,13 +1159,17 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn +seed: 4096 stop_number: - 4 - 3 total_containers: 100000 +transfer_cost_factors: + dsch: 0.05 + load: 0.05 vessels: a3s_vessel_000: - capacity: 871 + capacity: 483 parking: duration: 1 noise: 1 @@ -1177,10 +1177,10 @@ vessels: initial_port_name: yantian_chn route_name: a3s sailing: - noise: 2 + noise: 1 speed: 10 a3s_vessel_001: - capacity: 967 + capacity: 483 parking: duration: 1 noise: 1 @@ -1188,10 +1188,10 @@ vessels: initial_port_name: sydney_aus route_name: a3s sailing: - noise: 2 + noise: 1 speed: 9 asa_vessel_000: - capacity: 601 + capacity: 273 parking: duration: 1 noise: 1 @@ -1199,10 +1199,10 @@ vessels: initial_port_name: singapore_sgp route_name: asa sailing: - noise: 1 + noise: 2 speed: 8 asa_vessel_001: - capacity: 493 + capacity: 273 parking: duration: 1 noise: 1 @@ -1210,10 +1210,10 @@ vessels: initial_port_name: melbourne_aus route_name: asa sailing: - noise: 2 + noise: 1 speed: 10 ate1_vessel_000: - capacity: 5758 + capacity: 2879 parking: duration: 1 noise: 1 @@ -1221,10 +1221,10 @@ vessels: initial_port_name: newYork_usa route_name: ate1 sailing: - noise: 1 + noise: 2 speed: 9 ate1_vessel_001: - capacity: 6333 + capacity: 2879 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 8 gex1_vessel_000: - capacity: 1033 + capacity: 573 parking: duration: 1 noise: 1 @@ -1243,10 +1243,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: gex1 sailing: - noise: 2 + noise: 1 speed: 10 gex1_vessel_001: - capacity: 1147 + capacity: 573 parking: duration: 1 noise: 1 @@ -1257,7 +1257,7 @@ vessels: noise: 1 speed: 9 ktx5_vessel_000: - capacity: 1557 + capacity: 708 parking: duration: 1 noise: 1 @@ -1268,7 +1268,7 @@ vessels: noise: 1 speed: 8 ktx5_vessel_001: - capacity: 1275 + capacity: 708 parking: duration: 1 noise: 1 @@ -1276,10 +1276,10 @@ vessels: initial_port_name: yokohama_jpn route_name: ktx5 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_000: - capacity: 6603 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1290,7 +1290,7 @@ vessels: noise: 2 speed: 9 ll4_vessel_001: - capacity: 7263 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_002: - capacity: 5943 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1309,10 +1309,10 @@ vessels: initial_port_name: singapore_sgp route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_003: - capacity: 6603 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 9 ll4_vessel_004: - capacity: 7263 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1331,10 +1331,10 @@ vessels: initial_port_name: pusan_kor route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 8 ll4_vessel_005: - capacity: 5943 + capacity: 3301 parking: duration: 1 noise: 1 @@ -1342,10 +1342,10 @@ vessels: initial_port_name: qingdao_chn route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 pcc1_vessel_000: - capacity: 4922 + capacity: 2461 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 9 pcc1_vessel_001: - capacity: 5414 + capacity: 2461 parking: duration: 1 noise: 1 @@ -1364,10 +1364,10 @@ vessels: initial_port_name: qingdao_chn route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 8 pcc1_vessel_002: - capacity: 4430 + capacity: 2461 parking: duration: 1 noise: 1 @@ -1375,10 +1375,10 @@ vessels: initial_port_name: princeRupert_can route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 10 pcc2_vessel_000: - capacity: 2443 + capacity: 1221 parking: duration: 1 noise: 1 @@ -1389,7 +1389,7 @@ vessels: noise: 2 speed: 9 pcc2_vessel_001: - capacity: 2687 + capacity: 1221 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 8 pcc2_vessel_002: - capacity: 2199 + capacity: 1221 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 2129 + capacity: 1064 parking: duration: 1 noise: 1 @@ -1422,7 +1422,7 @@ vessels: noise: 1 speed: 9 pnw1_vessel_001: - capacity: 2341 + capacity: 1064 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 8 pnw1_vessel_002: - capacity: 1917 + capacity: 1064 parking: duration: 1 noise: 1 @@ -1444,7 +1444,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_000: - capacity: 897 + capacity: 448 parking: duration: 1 noise: 1 @@ -1452,10 +1452,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 9 pnw2_vessel_001: - capacity: 986 + capacity: 448 parking: duration: 1 noise: 1 @@ -1463,10 +1463,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 8 pnw2_vessel_002: - capacity: 808 + capacity: 448 parking: duration: 1 noise: 1 @@ -1477,7 +1477,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_003: - capacity: 897 + capacity: 448 parking: duration: 1 noise: 1 @@ -1488,7 +1488,7 @@ vessels: noise: 1 speed: 9 pnw2_vessel_004: - capacity: 986 + capacity: 448 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 8 saf3_vessel_000: - capacity: 583 + capacity: 323 parking: duration: 1 noise: 1 @@ -1510,7 +1510,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_001: - capacity: 647 + capacity: 323 parking: duration: 1 noise: 1 @@ -1518,10 +1518,10 @@ vessels: initial_port_name: qingdao_chn route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 9 saf3_vessel_002: - capacity: 711 + capacity: 323 parking: duration: 1 noise: 1 @@ -1529,10 +1529,10 @@ vessels: initial_port_name: singapore_sgp route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 8 saf3_vessel_003: - capacity: 583 + capacity: 323 parking: duration: 1 noise: 1 @@ -1540,10 +1540,10 @@ vessels: initial_port_name: durban_sau route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_000: - capacity: 1185 + capacity: 592 parking: duration: 1 noise: 1 @@ -1551,10 +1551,10 @@ vessels: initial_port_name: itagual_bra route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 9 tla2_vessel_001: - capacity: 1303 + capacity: 592 parking: duration: 1 noise: 1 @@ -1562,10 +1562,10 @@ vessels: initial_port_name: santos_bra route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 8 tla2_vessel_002: - capacity: 1067 + capacity: 592 parking: duration: 1 noise: 1 @@ -1573,10 +1573,10 @@ vessels: initial_port_name: singapore_sgp route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_003: - capacity: 1185 + capacity: 592 parking: duration: 1 noise: 1 @@ -1587,7 +1587,7 @@ vessels: noise: 1 speed: 9 tla2_vessel_004: - capacity: 1303 + capacity: 592 parking: duration: 1 noise: 1 @@ -1595,10 +1595,10 @@ vessels: initial_port_name: qingdao_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 8 tla2_vessel_005: - capacity: 1067 + capacity: 592 parking: duration: 1 noise: 1 @@ -1606,10 +1606,10 @@ vessels: initial_port_name: yantian_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tlp1_vessel_000: - capacity: 6332 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_001: - capacity: 6965 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1628,10 +1628,10 @@ vessels: initial_port_name: manzanillo_mex route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 8 tlp1_vessel_002: - capacity: 5699 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 6332 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_004: - capacity: 6965 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1664,7 +1664,7 @@ vessels: noise: 1 speed: 8 tlp1_vessel_005: - capacity: 5699 + capacity: 3166 parking: duration: 1 noise: 1 @@ -1672,5 +1672,5 @@ vessels: initial_port_name: yokohama_jpn route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 10 From 44754f9a9866fdfeb2619788afdc358f14210c65 Mon Sep 17 00:00:00 2001 From: wesley Date: Fri, 25 Sep 2020 11:35:27 +0800 Subject: [PATCH 06/25] polish coding style in cim.gnn --- examples/cim/gnn/action_shaper.py | 1 + examples/cim/gnn/actor.py | 8 ++---- examples/cim/gnn/actor_critic.py | 41 ++++++++++++++------------- examples/cim/gnn/agent.py | 7 +++-- examples/cim/gnn/agent_manager.py | 4 +-- examples/cim/gnn/config.yml | 1 - examples/cim/gnn/experience_shaper.py | 1 - examples/cim/gnn/launcher.py | 17 ++++------- examples/cim/gnn/learner.py | 28 ++++++++++-------- examples/cim/gnn/numpy_store.py | 6 ++-- examples/cim/gnn/simple_gnn.py | 14 +++------ examples/cim/gnn/state_shaper.py | 5 ++-- examples/cim/gnn/utils.py | 17 ++++++----- 13 files changed, 71 insertions(+), 79 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index b568a3fa8..5c40a0d7e 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -3,6 +3,7 @@ class DiscreteActionShaper(ActionShaper): def __init__(self, action_dim): + super.__init__() self._action_dim = action_dim self._zero_action = self._action_dim // 2 diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 352ba40e4..4f6521e8a 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -1,15 +1,11 @@ import time, os, pickle, math import multiprocessing import numpy as np -import torch.nn.functional as F -from torch.distributions import Categorical import ctypes import torch from multiprocessing import Process, Pipe, Event, Manager -from maro.simulator import Env from maro.rl import AbsActor -from examples.cim.gnn.numpy_store import NumpyStore, Shuffler from examples.cim.gnn.action_shaper import DiscreteActionShaper from examples.cim.gnn.utils import fix_seed, gnn_union from examples.cim.gnn.experience_shaper import ExperienceShaper @@ -203,6 +199,7 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): logger: The logger instance to log information during the rollout. ''' + super().__init__(demo_env, agent_manager) multiprocessing.set_start_method('spawn', True) self._logger = logger self.config = config @@ -210,7 +207,6 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self._static_node_mapping = demo_env.summary['node_mapping']['ports'] self._dynamic_node_mapping = demo_env.summary['node_mapping']['vessels'] self._gnn_state_shaper = gnn_state_shaper - self._agent_manager = agent_manager self.device = torch.device(config.training.device) self.parallel_cnt = config.training.parallel_cnt @@ -328,7 +324,7 @@ def roll_out(self): assert(np.min(self.action_io_np['vid']) == np.max(self.action_io_np['vid'])) t = time.time() - actions = self._agent_manager.choose_action(agent_id = (self.action_io_np['pid'][0], self.action_io_np['vid'][0]), state=graph) + actions = self._inference_agents.choose_action(agent_id = (self.action_io_np['pid'][0], self.action_io_np['vid'][0]), state=graph) t_action += time.time() - t for i, p in enumerate(self.pipes): diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index 0f9d5b035..f32ce8ff1 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -1,9 +1,7 @@ -import numpy as np - -import torch, os -from torch.distributions import Categorical +import os +import torch from torch import nn -import torch.nn.functional as F +from torch.distributions import Categorical from torch.nn.utils import clip_grad from maro.rl import AbsAlgorithm @@ -11,26 +9,27 @@ from .utils import gnn_union class ActorCritic(AbsAlgorithm): - def __init__(self, model: nn.Module, - device: torch.device, + ''' + + Actor-Critic algorithm in CIM problem. + + Args: + model (nn.Module): A actor-critic module outputing both the policy network and the value network + device (torch.device): A PyTorch device instance where the module is computed on. + p2p_adj (numpy.array): The static port-to-port adjencency matrix. + td_steps (int): The value 'n' in the n-step TD algorithm. + gamma (float): The time decay. + learning_rate (float): The learning rate for the module. + entropy_factor (float): The weight of the policy's entropy to boost exploration. + ''' + + def __init__(self, model: nn.Module, + device: torch.device, p2p_adj=None, td_steps=100, gamma=0.97, learning_rate=0.0003, entropy_factor=0.1): - ''' - - Actor-Critic algorithm in CIM problem. - - Args: - model (nn.Module): A actor-critic module outputing both the policy network and the value network - device (torch.device): A PyTorch device instance where the module is computed on. - p2p_adj (numpy.array): The static port-to-port adjencency matrix. - td_steps (int): The value 'n' in the n-step TD algorithm. - gamma (float): The time decay. - learning_rate (float): The learning rate for the module. - entropy_factor (float): The weight of the policy's entropy to boost exploration. - ''' self._model = model self._gamma = gamma @@ -41,6 +40,8 @@ def __init__(self, model: nn.Module, self._device = device self._tot_batchs = 0 self._p2p_adj = p2p_adj + super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": self._optimizer}, loss_func_dict={}, + hyper_params=None) def choose_action(self, state: dict, p_idx: int, v_idx: int): ''' diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index 48045332e..d8dac2a90 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -29,8 +29,11 @@ def train(self, training_config): c_loss = np.mean(loss_dict['critic']) e_loss = np.mean(loss_dict['entropy']) tot_loss = np.mean(loss_dict['tot']) - self._logger.debug('code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f'%(str(self._name), a_loss, - c_loss, e_loss, tot_loss)) + self._logger.debug('code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f'%(str(self._name), + float(a_loss), + float(c_loss), + float(e_loss), + float(tot_loss))) self._experience_pool.clear() return loss_dict diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index f9969a931..8ddfa3b0c 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -1,9 +1,9 @@ from maro.rl import AbsAgentManager, AgentMode from examples.cim.gnn.agent import TrainableAgent from examples.cim.gnn.actor_critic import ActorCritic -# from examples.cim.gnn.differ_gnn_model import SharedAC from examples.cim.gnn.simple_gnn import SharedAC from examples.cim.gnn.numpy_store import NumpyStore +from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.utils import compute_v2p_degree_matrix from maro.utils import DummyLogger import numpy as np @@ -16,7 +16,7 @@ def __init__(self, name, port_code_list, vessel_code_list, demo_env, - state_shaper, + state_shaper:GNNStateShaper, logger=DummyLogger()): super().__init__(name, AgentMode.TRAIN, diff --git a/examples/cim/gnn/config.yml b/examples/cim/gnn/config.yml index b1ed28549..69b264716 100644 --- a/examples/cim/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -21,7 +21,6 @@ training: model: # path: '/data/log/20200119/demo_6p' path: '/dcdata/log/test' - path: none tick_buffer: 20 hidden_size: 32 graph_output_dim: 32 diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index 748f3f384..3f2eb30b9 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -1,6 +1,5 @@ import numpy as np from collections import defaultdict -import pickle as pkl class ExperienceShaper: def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, discount_factor=0.97, diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 6c49ccab8..34efcc44e 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -1,19 +1,14 @@ -import time, os -import torch -from examples.cim.gnn.numpy_store import NumpyStore, Shuffler -import numpy as np -from examples.cim.gnn.experience_shaper import ExperienceShaper -import multiprocessing -from collections import defaultdict +import os +import datetime + +from maro.simulator import Env +from maro.utils import Logger + from examples.cim.gnn.actor import ParallelActor from examples.cim.gnn.learner import GNNLearner -from maro.simulator import Env from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.utils import decision_cnt_analysis, load_config, save_config, save_code, return_scaler from examples.cim.gnn.agent_manager import SimpleAgentManger -from maro.utils import Logger, LogFormat -import datetime -import time if __name__ == "__main__": diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index ca9c17e29..bee8a3076 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -1,19 +1,23 @@ -from maro.rl import AbsLearner -from maro.rl import AbsActor -from maro.rl import AbsAgentManager -from maro.utils import DummyLogger import time import os +from maro.rl import AbsLearner +from maro.utils import DummyLogger + +from examples.cim.gnn.agent_manager import SimpleAgentManger +from examples.cim.gnn.actor import ParallelActor + class GNNLearner(AbsLearner): - def __init__(self, actor: AbsActor, trainable_agents:AbsAgentManager, logger=DummyLogger()): - """Learner class for the training pipeline and the specialized logging in GNN solution for CIM problem. - - Args: - actor (AbsActor): The actor instance to collect experience. - trainable_agents (AbsAgentManager): The agent manager for training RL models. - logger (Logger) - """ + """Learner class for the training pipeline and the specialized logging in GNN solution for CIM problem. + + Args: + actor (AbsActor): The actor instance to collect experience. + trainable_agents (AbsAgentManager): The agent manager for training RL models. + logger (Logger) + """ + + def __init__(self, actor: ParallelActor, trainable_agents:SimpleAgentManger, logger=DummyLogger()): + super().__init__() self._actor = actor self._trainable_agents = trainable_agents self._logger = logger diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index f322acffd..161a1dce9 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -1,7 +1,8 @@ import numpy as np -from maro.rl import AbsStore from typing import Sequence +from maro.rl import AbsStore + def get_item(data_dict, key_tuple): '''Helper function to get the value in a hierarchical dictionary given the key path. @@ -68,6 +69,7 @@ def __init__(self, domain_type_dict, capacity): capacity (int): The maximum stored experience in the store. """ + super().__init__() self.domain_type_dict = dict(domain_type_dict) self.store = {key: np.zeros(shape=(capacity, *shape) if batch_first else (shape[0], capacity, *shape[1:]), dtype=data_type) for key, (shape, data_type, batch_first) in domain_type_dict.items()} @@ -148,7 +150,7 @@ def __len__(self): def update(self, indexes: Sequence, contents: Sequence): raise NotImplementedError("NumpyStore does not support modifying the experience!") - def sample(self, size, replace: bool = True): + def sample(self, size, weights: Sequence, replace: bool = True): raise NotImplementedError("NumpyStore does not support sampling. Please use outer sampler to fetch samples!") def clear(self): diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 6aa4eca8d..63a27793d 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -1,20 +1,14 @@ +import math + import torch -from torch import Tensor -import copy import torch.nn as nn -import math -from torch.autograd import Variable +from torch import Tensor from torch.nn import functional as F - # lib for transformer -from torch.nn.modules.module import Module +from torch.nn import TransformerEncoder, TransformerEncoderLayer from torch.nn.modules.activation import MultiheadAttention -from torch.nn.modules.container import ModuleList -from torch.nn.init import xavier_uniform_ from torch.nn.modules.dropout import Dropout -from torch.nn.modules.linear import Linear from torch.nn.modules.normalization import LayerNorm -from torch.nn import TransformerEncoder, TransformerEncoderLayer class PositionalEncoder(nn.Module): ''' diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index 606a56fbc..dfeeafbb8 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -1,9 +1,8 @@ import numpy as np -import torch -import pickle as pkl +from maro.rl.shaping.state_shaper import StateShaper from .utils import compute_v2p_degree_matrix -class GNNStateShaper: +class GNNStateShaper(StateShaper): """State shaper to extract graph information. Args: diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 37f928478..95f9fb15b 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -1,17 +1,16 @@ -import numpy as np -import torch, sys, argparse -import json import ast, math +import io, yaml, os, shutil +import numpy as np +import random +import sys from collections import defaultdict, OrderedDict + +import torch +from torch.optim.lr_scheduler import LambdaLR + from maro.simulator.scenarios.cim.common import Action, DecisionEvent from maro.simulator import Env -import shutil from maro.utils import convert_dottable, clone -import io, yaml, os, shutil -import datetime -from torch.optim.lr_scheduler import LambdaLR -from torch.optim import SGD -import random def compute_v2p_degree_matrix(env): ''' From 1e78d0b570426121bfc615fe85c0913840af37d8 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Sun, 27 Sep 2020 11:32:01 +0800 Subject: [PATCH 07/25] run pass after polishing --- examples/cim/gnn/action_shaper.py | 2 +- examples/cim/gnn/actor_critic.py | 33 ++++++++++++++----------------- examples/cim/gnn/config.yml | 2 +- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 5c40a0d7e..297113d94 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -3,7 +3,7 @@ class DiscreteActionShaper(ActionShaper): def __init__(self, action_dim): - super.__init__() + super().__init__() self._action_dim = action_dim self._zero_action = self._action_dim // 2 diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index f32ce8ff1..1bc341979 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -6,7 +6,7 @@ from maro.rl import AbsAlgorithm -from .utils import gnn_union +from examples.cim.gnn.utils import gnn_union class ActorCritic(AbsAlgorithm): ''' @@ -30,17 +30,14 @@ def __init__(self, model: nn.Module, gamma=0.97, learning_rate=0.0003, entropy_factor=0.1): - self._model = model - self._gamma = gamma self._td_steps = td_steps self._value_discount = gamma**100 - self._optimizer = torch.optim.Adam(self._model.parameters(), lr=learning_rate) self._entropy_factor = entropy_factor self._device = device self._tot_batchs = 0 self._p2p_adj = p2p_adj - super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": self._optimizer}, loss_func_dict={}, + super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, loss_func_dict={}, hyper_params=None) def choose_action(self, state: dict, p_idx: int, v_idx: int): @@ -74,7 +71,7 @@ def choose_action(self, state: dict, p_idx: int, v_idx: int): model_action (numpy.int64): The action returned from the module ''' with torch.no_grad(): - prob, _ = self._model(state, a=True, p_idx=p_idx, v_idx=v_idx) + prob, _ = self._model_dict["a&c"](state, a=True, p_idx=p_idx, v_idx=v_idx) distribution = Categorical(prob) model_action = distribution.sample().cpu().numpy() return model_action @@ -119,17 +116,17 @@ def train(self, batch, p_idx, v_idx): # train actor network # self._actor_optimizer.zero_grad() # self._critic_optimizer.zero_grad() - self._optimizer.zero_grad() + self._optimizer["a&c"].zero_grad() # every port has a value # values.shape: (batch, p_cnt) - probs, values = self._model(obs_batch, a=True, p_idx=p_idx, v_idx=v_idx, c=True) + probs, values = self._model_dict["a&c"](obs_batch, a=True, p_idx=p_idx, v_idx=v_idx, c=True) distribution = Categorical(probs) log_prob = distribution.log_prob(action_batch) entropy_loss = distribution.entropy() - _, values_ = self._model(next_obs_batch, c=True) + _, values_ = self._model_dict["a&c"](next_obs_batch, c=True) advantage = return_batch + self._value_discount * values_.detach() - values if self._entropy_factor != 0: @@ -139,7 +136,7 @@ def train(self, batch, p_idx, v_idx): actor_loss = - (log_prob*torch.sum(advantage, axis=-1).detach()).mean() # actor_loss.backward(retain_graph=True) - # self._actor_optimizer.step() + # self._actor_optimizer["a&c"].step() item_a_loss = actor_loss.item() item_e_loss = entropy_loss.mean().item() @@ -149,18 +146,18 @@ def train(self, batch, p_idx, v_idx): # critic_loss.backward() item_c_loss = critic_loss.item() # torch.nn.utils.clip_grad_norm_(self._critic_model.parameters(),0.5) - # self._critic_optimizer.step() + # self._critic_optimizer["a&c"].step() tot_loss = 0.1*actor_loss + critic_loss # - self._entropy_factor * entropy_loss tot_loss.backward() - tot_norm = clip_grad.clip_grad_norm_(self._model.parameters(), 1) - self._optimizer.step() + tot_norm = clip_grad.clip_grad_norm_(self._model_dict["a&c"].parameters(), 1) + self._optimizer["a&c"].step() return item_a_loss, item_c_loss, item_e_loss, float(tot_norm) def set_weights(self, weights): - self._model.load_state_dict(weights) + self._model_dict["a&c"].load_state_dict(weights) def get_weights(self): - return self._model.state_dict() + return self._model_dict["a&c"].state_dict() def _get_save_idx(self, fp_str): return int(fp_str.split('.')[0].split('_')[0]) @@ -169,12 +166,12 @@ def save_model(self, pth, id): if not os.path.exists(pth): os.makedirs(pth) pth = os.path.join(pth, '%d_ac.pkl'%id) - torch.save(self._model.state_dict(), pth) + torch.save(self._model_dict["a&c"].state_dict(), pth) def _set_gnn_weights(self, weights): for key in weights: - if key in self._model.state_dict().keys(): - self._model.state_dict()[key].copy_(weights[key]) + if key in self._model_dict["a&c"].state_dict().keys(): + self._model_dict["a&c"].state_dict()[key].copy_(weights[key]) def load_model(self, folder_pth, idx=-1): if idx == -1: diff --git a/examples/cim/gnn/config.yml b/examples/cim/gnn/config.yml index 69b264716..a06dd17f4 100644 --- a/examples/cim/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -8,7 +8,7 @@ env: training: enable: True parallel_cnt: 24 - device: 'cuda:1' + device: 'cuda:0' batch_size: 150 shuffle_time: 1 rollout_cnt: 1000 From 686cd3324e2ecf2d5ace11cb1360eb97c24cffee Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Sat, 10 Oct 2020 08:56:57 +0800 Subject: [PATCH 08/25] change the name of simplegat to simple_transformer --- examples/cim/gnn/simple_gnn.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 63a27793d..00ba8e58b 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -129,7 +129,9 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor dest_emb = self.att_norm(dest_emb) return dest_emb.reshape(batch, d_cnt, self.hidden_size) -class SimpleGAT(nn.Module): + + +class SimpleTransformer(nn.Module): """Graph attention network with multiple graph in the CIM scenario. This module aggregates information in the port-to-port graph, port-to-vessel graph and vessel-to-port graph. The @@ -265,7 +267,7 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3) self.gnn_output_size = 32*scale - self.trans_gat = SimpleGAT( + self.trans_gat = SimpleTransformer( p_dim=self.pre_dim_p, v_dim=self.pre_dim_v, output_size=self.gnn_output_size//2, From 7c3a9cdc9a58e598b5b447f39c65debeb6f83cae Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Mon, 12 Oct 2020 15:49:03 +0800 Subject: [PATCH 09/25] fix typo and suggestions --- examples/cim/gnn/action_shaper.py | 15 ++++--- examples/cim/gnn/actor.py | 64 +++++++++++++-------------- examples/cim/gnn/actor_critic.py | 25 ++++++----- examples/cim/gnn/agent_manager.py | 8 +++- examples/cim/gnn/experience_shaper.py | 46 ++++++++++++------- examples/cim/gnn/learner.py | 4 +- examples/cim/gnn/numpy_store.py | 8 ++-- examples/cim/gnn/simple_gnn.py | 4 +- examples/cim/gnn/state_shaper.py | 12 ++--- examples/cim/gnn/utils.py | 23 +++++----- 10 files changed, 118 insertions(+), 91 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 297113d94..3ed2c5334 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -2,21 +2,24 @@ from maro.rl import ActionShaper class DiscreteActionShaper(ActionShaper): + """The shaping class to transform the action in [-1, 1] to actual repositioning function. + """ def __init__(self, action_dim): super().__init__() self._action_dim = action_dim self._zero_action = self._action_dim // 2 def __call__(self, pending_action, model_action): - ''' + """Shaping the action in [-1,1] range to the actual repositioning function. + This function maps integer model action within the range of [-A, A] to actual action. We define negative actual action as discharge resource from vessel to port and positive action as upload from port to vessel, so the upper bound and lower bound of actual action are the resource in dynamic and static node respectively. Args: - pending_action (Event) - model_action (int): output action, range A means the half of the agent output dim - ''' + pending_action (Event): The decision event from the environment. + model_action (int): Output action, range A means the half of the agent output dim. + """ tick = pending_action.tick env_action = 0 action_index = model_action @@ -25,12 +28,12 @@ def __call__(self, pending_action, model_action): action_scope = pending_action.action_scope if model_action < 0: - # discharge resource from dynamic node + # Discharge resource from dynamic node env_action = round(int(model_action) * 1.0/self._zero_action * action_scope.load) elif model_action == 0: env_action =0 else: - # load resource to dynamic node + # Load resource to dynamic node env_action = round(int(model_action) * 1.0/self._zero_action * action_scope.discharge) env_action = int(env_action) diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 4f6521e8a..3da100f67 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -1,28 +1,27 @@ -import time, os, pickle, math +import ctypes +from collections import defaultdict, OrderedDict import multiprocessing +from multiprocessing import Process, Pipe, Event, Manager import numpy as np -import ctypes +import time, os, pickle + import torch -from multiprocessing import Process, Pipe, Event, Manager from maro.rl import AbsActor +from maro.simulator import Env +from maro.simulator.scenarios.cim.common import Action, DecisionEvent +from maro.utils import Logger, LogFormat, convert_dottable +from examples.cim.gnn.actor_critic import ActorCritic from examples.cim.gnn.action_shaper import DiscreteActionShaper from examples.cim.gnn.utils import fix_seed, gnn_union from examples.cim.gnn.experience_shaper import ExperienceShaper from examples.cim.gnn.state_shaper import GNNStateShaper -from collections import defaultdict, OrderedDict -from examples.cim.gnn.actor_critic import ActorCritic -from maro.simulator import Env -from maro.simulator.scenarios.cim.common import Action, DecisionEvent -from maro.utils import Logger, LogFormat, convert_dottable from examples.cim.gnn.shared_structure import SharedStructure from examples.cim.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix -import random def organize_exp_list(experience_collections:dict, idx_mapping:dict): - ''' - The function assemble the experience from multiple processes into a dictionary. + """The function assemble the experience from multiple processes into a dictionary. Args: experience_collections (dict): It stores the experience in all agents. The structure is the same as what is @@ -49,7 +48,7 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): idx_mapping (dict): The key is the name of each agent and the value is the starting index, e.g., b_x, of the storage space where the experience of the agent is stored. - ''' + """ result = {} tmpi = 0 for code, idx in idx_mapping.items(): @@ -73,8 +72,8 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): return result def organize_obs(obs, idx, exp_len): - '''Helper function to transform the observation from multiple processes to a unified dictionary. - ''' + """Helper function to transform the observation from multiple processes to a unified dictionary. + """ tick_buffer, _, para_cnt, v_cnt, v_dim = obs['v'].shape _, _, _, p_cnt, p_dim = obs['p'].shape batch = exp_len * para_cnt @@ -103,7 +102,7 @@ def organize_obs(obs, idx, exp_len): def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_output): - '''The A2C worker function to collect experience. + """The A2C worker function to collect experience. Args: index (int): The process index counted from 0. @@ -115,7 +114,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou action_io (SharedStructure): The shared memory to hold the state information that the main process uses to generate an action. exp_output (SharedStructure): The shared memory to transfer the experience list to the main process. - ''' + """ env = Env(**config.env.param) fix_seed(env, config.env.seed) static_code_list, dynamic_code_list = list(env.summary['node_mapping']['ports'].values()), \ @@ -177,13 +176,13 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou print('the end') def compute_shortage(snapshot_list, max_tick, static_code_list): - '''Helper function to compute the shortage after a episode end. - ''' + """Helper function to compute the shortage after a episode end. + """ return np.sum(snapshot_list["ports"][max_tick-1: static_code_list: "acc_shortage"]) class ParallelActor(AbsActor): def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): - '''A2C rollout class + """A2C rollout class. This implements the synchronized A2C structure. Multiple processes are created to simulate and collect experience where only CPU is needed and whenever an action is required, they notify the main process and the @@ -198,7 +197,7 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): agent_manager (AbsAgentManger): The agent manager instance to do the action inference in batch. logger: The logger instance to log information during the rollout. - ''' + """ super().__init__(demo_env, agent_manager) multiprocessing.set_start_method('spawn', True) self._logger = logger @@ -215,8 +214,10 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): tick_buffer = config.model.tick_buffer action_dim = config.model.action_dim - v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim('v'), self._gnn_state_shaper.get_input_dim('vedge'), len(self._dynamic_node_mapping) - p_dim, pedge_dim, p_cnt = self._gnn_state_shaper.get_input_dim('p'), self._gnn_state_shaper.get_input_dim('pedge'), len(self._static_node_mapping) + v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim('v'), \ + self._gnn_state_shaper.get_input_dim('vedge'), len(self._dynamic_node_mapping) + p_dim, pedge_dim, p_cnt = self._gnn_state_shaper.get_input_dim('p'), \ + self._gnn_state_shaper.get_input_dim('pedge'), len(self._static_node_mapping) self.pipes = [Pipe() for i in range(self.parallel_cnt)] @@ -288,11 +289,11 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self._roll_out_cnt = 0 def roll_out(self): - '''Rollout using current policy in the AgentManager. + """Rollout using current policy in the AgentManager. Returns: result (dict): The key is the agent code, the value is the experience list stored in numpy.array. - ''' + """ # compute the time used for state preparation in the child process. t_state = 0 @@ -316,7 +317,8 @@ def roll_out(self): t = time.time() graph = gnn_union(self.action_io_np['p'], self.action_io_np['po'], self.action_io_np['pedge'], self.action_io_np['v'], self.action_io_np['vo'], self.action_io_np['vedge'], - self._gnn_state_shaper.p2p_static_graph, self.action_io_np['ppedge'], self.action_io_np['mask'], self.device) + self._gnn_state_shaper.p2p_static_graph, self.action_io_np['ppedge'], + self.action_io_np['mask'], self.device) t_state += time.time() - t # print(self.action_io_np['pid']) @@ -324,7 +326,8 @@ def roll_out(self): assert(np.min(self.action_io_np['vid']) == np.max(self.action_io_np['vid'])) t = time.time() - actions = self._inference_agents.choose_action(agent_id = (self.action_io_np['pid'][0], self.action_io_np['vid'][0]), state=graph) + actions = self._inference_agents.choose_action(agent_id = (self.action_io_np['pid'][0], + self.action_io_np['vid'][0]), state=graph) t_action += time.time() - t for i, p in enumerate(self.pipes): @@ -359,13 +362,8 @@ def roll_out(self): return result def exit(self): - '''Terminate the child processes. - ''' + """Terminate the child processes. + """ for p in self.pipes: p[0].send('close') - def save_model(self, pth, id): - self._algorithm.save_model(pth, id) - - def load_model(self, pth): - self._algorithm.load_model(pth) diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index 1bc341979..d7e88f058 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -1,27 +1,27 @@ import os + import torch from torch import nn from torch.distributions import Categorical from torch.nn.utils import clip_grad from maro.rl import AbsAlgorithm - from examples.cim.gnn.utils import gnn_union class ActorCritic(AbsAlgorithm): - ''' + """Actor-Critic algorithm in CIM problem. - Actor-Critic algorithm in CIM problem. + The vanilla ac algorithm. Args: - model (nn.Module): A actor-critic module outputing both the policy network and the value network + model (nn.Module): A actor-critic module outputing both the policy network and the value network. device (torch.device): A PyTorch device instance where the module is computed on. p2p_adj (numpy.array): The static port-to-port adjencency matrix. td_steps (int): The value 'n' in the n-step TD algorithm. gamma (float): The time decay. learning_rate (float): The learning rate for the module. entropy_factor (float): The weight of the policy's entropy to boost exploration. - ''' + """ def __init__(self, model: nn.Module, device: torch.device, @@ -37,11 +37,13 @@ def __init__(self, model: nn.Module, self._device = device self._tot_batchs = 0 self._p2p_adj = p2p_adj - super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, loss_func_dict={}, + super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, + loss_func_dict={}, hyper_params=None) def choose_action(self, state: dict, p_idx: int, v_idx: int): - ''' + """Get action from the AC model. + Args: state (dict): A dictionary containing the input to the module. For example: { @@ -68,8 +70,8 @@ def choose_action(self, state: dict, p_idx: int, v_idx: int): v_idx (int): The identity of the vessel doing the action. Returns: - model_action (numpy.int64): The action returned from the module - ''' + model_action (numpy.int64): The action returned from the module. + """ with torch.no_grad(): prob, _ = self._model_dict["a&c"](state, a=True, p_idx=p_idx, v_idx=v_idx) distribution = Categorical(prob) @@ -77,7 +79,8 @@ def choose_action(self, state: dict, p_idx: int, v_idx: int): return model_action def train(self, batch, p_idx, v_idx): - ''' + """Model training. + Args: batch (dict): The dictionary of a batch of experience. For example: { @@ -95,7 +98,7 @@ def train(self, batch, p_idx, v_idx): e_loss (float): entropy loss. tot_norm (float): the L2 norm of the gradient. - ''' + """ self._tot_batchs += 1 item_a_loss, item_c_loss, item_e_loss = 0, 0, 0 obs_batch = batch['s'] diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index 8ddfa3b0c..d2008cd8a 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -82,4 +82,10 @@ def train(self, training_config): def store_experiences(self, experiences): for code, exp_list in experiences.items(): - self._agent_dict[code].store_experiences(exp_list) \ No newline at end of file + self._agent_dict[code].store_experiences(exp_list) + + def save_model(self, pth, id): + self._algorithm.save_model(pth, id) + + def load_model(self, pth): + self._algorithm.load_model(pth) \ No newline at end of file diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index 3f2eb30b9..d1acec206 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -2,8 +2,8 @@ from collections import defaultdict class ExperienceShaper: - def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, discount_factor=0.97, - idx=-1, shared_storage=None, exp_idx_mapping=None): + def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, + discount_factor=0.97, idx=-1, shared_storage=None, exp_idx_mapping=None): self._static_list = list(static_list) self._dynamic_list = list(dynamic_list) self._time_slot = time_slot @@ -52,7 +52,8 @@ def __call__(self, snapshot_list): return shortage = snapshot_list["ports"][self._tick_range:self._static_list:"shortage"].reshape(self._max_tick, -1) - fulfillment = snapshot_list["ports"][self._tick_range:self._static_list:"fulfillment"].reshape(self._max_tick, -1) + fulfillment = snapshot_list["ports"][self._tick_range:self._static_list:"fulfillment"] \ + .reshape(self._max_tick, -1) # tot_shortage = np.sum(shortage, axis=1) # tot_fulfillment = np.sum(fulfillment, axis=1) delta = fulfillment - shortage @@ -75,21 +76,34 @@ def __call__(self, snapshot_list): exp_len = len(exp_list) # here, we assume that exp_idx_mapping order is not changed. self._shared_storage['len'][self._idx, tmpi] = exp_len - self._shared_storage['s']['v'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['v'] for e in exp_list], axis=1) - self._shared_storage['s']['p'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['p'] for e in exp_list], axis=1) - self._shared_storage['s']['vo'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['vo'] for e in exp_list], axis=0) - self._shared_storage['s']['po'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['po'] for e in exp_list], axis=0) - self._shared_storage['s']['vedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['vedge'] for e in exp_list], axis=0) - self._shared_storage['s']['pedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s']['pedge'] for e in exp_list], axis=0) + self._shared_storage['s']['v'][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s']['v'] for e in exp_list], axis=1) + self._shared_storage['s']['p'][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s']['p'] for e in exp_list], axis=1) + self._shared_storage['s']['vo'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s']['vo'] for e in exp_list], axis=0) + self._shared_storage['s']['po'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s']['po'] for e in exp_list], axis=0) + self._shared_storage['s']['vedge'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s']['vedge'] for e in exp_list], axis=0) + self._shared_storage['s']['pedge'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s']['pedge'] for e in exp_list], axis=0) - self._shared_storage['s_']['v'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['v'] for e in exp_list], axis=1) - self._shared_storage['s_']['p'][:, idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['p'] for e in exp_list], axis=1) - self._shared_storage['s_']['vo'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['vo'] for e in exp_list], axis=0) - self._shared_storage['s_']['po'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['po'] for e in exp_list], axis=0) - self._shared_storage['s_']['vedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['vedge'] for e in exp_list], axis=0) - self._shared_storage['s_']['pedge'][idx_base:idx_base+exp_len, self._idx] = np.stack([e['s_']['pedge'] for e in exp_list], axis=0) + self._shared_storage['s_']['v'][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s_']['v'] for e in exp_list], axis=1) + self._shared_storage['s_']['p'][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s_']['p'] for e in exp_list], axis=1) + self._shared_storage['s_']['vo'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s_']['vo'] for e in exp_list], axis=0) + self._shared_storage['s_']['po'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s_']['po'] for e in exp_list], axis=0) + self._shared_storage['s_']['vedge'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s_']['vedge'] for e in exp_list], axis=0) + self._shared_storage['s_']['pedge'][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e['s_']['pedge'] for e in exp_list], axis=0) - self._shared_storage['a'][idx_base:idx_base+exp_len, self._idx] = np.array([exp['a'] for exp in exp_list], dtype=np.int64) + self._shared_storage['a'][idx_base:idx_base+exp_len, self._idx] = \ + np.array([exp['a'] for exp in exp_list], dtype=np.int64) self._shared_storage['R'][idx_base:idx_base+exp_len, self._idx] = np.vstack([exp['R'] for exp in exp_list]) tmpi += 1 diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index bee8a3076..c06cd8cbb 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -13,7 +13,7 @@ class GNNLearner(AbsLearner): Args: actor (AbsActor): The actor instance to collect experience. trainable_agents (AbsAgentManager): The agent manager for training RL models. - logger (Logger) + logger (Logger): The logger to save/print the message. """ def __init__(self, actor: ParallelActor, trainable_agents:SimpleAgentManger, logger=DummyLogger()): @@ -44,7 +44,7 @@ def train(self, training_config, log_pth=None): training_time += time.time() - tick if log_pth is not None and (i+1) % training_config.model_save_freq == 0: - self._actor.save_model(os.path.join(log_pth, 'models'), i+1) + self._trainable_agents.save_model(os.path.join(log_pth, 'models'), i+1) self._logger.debug('total rollout_time: %d' % int(rollout_time)) self._logger.debug('train_time: %d' % int(training_time)) diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index 161a1dce9..fb5d90127 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -5,7 +5,7 @@ def get_item(data_dict, key_tuple): - '''Helper function to get the value in a hierarchical dictionary given the key path. + """Helper function to get the value in a hierarchical dictionary given the key path. Args: data_dict (dict): The data structure. For example: @@ -20,15 +20,15 @@ def get_item(data_dict, key_tuple): key_tuple (tuple): The key path to the target field. For example, given the data_dict above, the key_tuple ('a', 'c', 'd') should return 2. - ''' + """ for key in key_tuple: data_dict = data_dict[key] return data_dict def set_item(data_dict, key_tuple, data): - '''The setter function corresponding to the get_item function. - ''' + """The setter function corresponding to the get_item function. + """ for i, key in enumerate(key_tuple): if key not in data_dict: data_dict[key] = {} diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 00ba8e58b..5f736b2a4 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -11,12 +11,12 @@ from torch.nn.modules.normalization import LayerNorm class PositionalEncoder(nn.Module): - ''' + """ The positional encoding used in transformer to get the sequential information. The code is based on the PyTorch version in web https://pytorch.org/tutorials/beginner/transformer_tutorial.html?highlight=positionalencoding - ''' + """ def __init__(self, d_model, max_seq_len = 80): super().__init__() diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index dfeeafbb8..ce5206214 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -87,9 +87,9 @@ def p2p_static_graph(self): return self._p2p_embedding def sort(self, arrival_time, attr=None): - ''' + """ given the arrival time matrix, this function sort the matrix and return the index matrix in the order of arrival time - ''' + """ n, m = arrival_time.shape if self._feature_config.attention_order == 'ramdom': arrival_time = arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape) @@ -105,7 +105,7 @@ def sort(self, arrival_time, attr=None): else: return at_index, attr - ''' + """ def arg_idx(self, arrival_time, p_or_v): if self._feature_config.attention_order == 'temporal': return self.sort(arrival_time) @@ -114,7 +114,7 @@ def arg_idx(self, arrival_time, p_or_v): else: # randomize the arrival time return self.sort(arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape)) - ''' + """ def end_ep_callback(self, snapshot_list): if self._only_demo: @@ -128,9 +128,9 @@ def end_ep_callback(self, snapshot_list): self.last_tick = -1 def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): - ''' + """ this function update the state_dict from snapshot_list in the given tick_range - ''' + """ if len(tick_range) == 0: # this occurs when two actions happen at the same tick return diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 95f9fb15b..92443585d 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -13,9 +13,8 @@ from maro.utils import convert_dottable, clone def compute_v2p_degree_matrix(env): - ''' - this function compute the adjacent matrix - ''' + """This function compute the adjacent matrix + """ topo_config = env.configs static_dict = env.summary['node_mapping']['ports'] dynamic_dict = env.summary['node_mapping']['vessels'] @@ -37,11 +36,15 @@ def from_numpy(device, *np_values): return [torch.from_numpy(v).to(device) for v in np_values] def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): - ''' - v: (seq_len, batch, v_cnt, v_dim) - vo: (batch, v_cnt, p_cnt) - vedge: (batch, v_cnt, p_cnt, e_dim) - ''' + """Union multiple graph in CIM. + + Args: + v: Numpy array of shape (seq_len, batch, v_cnt, v_dim). + vo: Numpy array of shape (batch, v_cnt, p_cnt). + vedge: Numpy array of shape (batch, v_cnt, p_cnt, e_dim). + Returns: + result (dict): The dictionary that describes the graph. + """ seq_len, batch, v_cnt, v_dim = v.shape _, _, p_cnt, p_dim = p.shape @@ -152,14 +155,14 @@ def random_shortage(env, tick, action_dim=21): r, pa, is_done = env.step(None) node_cnt = len(env.summary['node_mapping']['ports']) while not is_done: - ''' + """ load, discharge = pa.action_scope.load, pa.action_scope.discharge action_idx = np.random.randint(action_dim) - zero_idx if action_idx < 0: actual_action = int(1.0*action_idx/zero_idx*load) else: actual_action = int(1.0*action_idx/zero_idx*discharge) - ''' + """ # print(action_idx, -load, actual_action, discharge) action = Action(pa.vessel_idx, pa.port_idx, 0) r, pa, is_done = env.step(action) From b1a400a5f3de48febc7fc0c1935a4d25e4c5a8cb Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Thu, 15 Oct 2020 14:30:38 +0800 Subject: [PATCH 10/25] fix format --- examples/cim/gnn/action_shaper.py | 17 +- examples/cim/gnn/actor.py | 267 +++++++++++++------------- examples/cim/gnn/actor_critic.py | 95 ++++----- examples/cim/gnn/agent.py | 25 ++- examples/cim/gnn/agent_manager.py | 64 +++--- examples/cim/gnn/config.yml | 13 +- examples/cim/gnn/experience_shaper.py | 92 ++++----- examples/cim/gnn/launcher.py | 32 +-- examples/cim/gnn/learner.py | 14 +- examples/cim/gnn/numpy_store.py | 54 +++--- examples/cim/gnn/shared_structure.py | 8 +- examples/cim/gnn/simple_gnn.py | 113 ++++++----- examples/cim/gnn/state_shaper.py | 108 +++++------ examples/cim/gnn/utils.py | 96 ++++----- 14 files changed, 498 insertions(+), 500 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 3ed2c5334..a91121fd9 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -1,4 +1,3 @@ -import math from maro.rl import ActionShaper class DiscreteActionShaper(ActionShaper): @@ -12,8 +11,8 @@ def __init__(self, action_dim): def __call__(self, pending_action, model_action): """Shaping the action in [-1,1] range to the actual repositioning function. - This function maps integer model action within the range of [-A, A] to actual action. We define negative actual - action as discharge resource from vessel to port and positive action as upload from port to vessel, so the + This function maps integer model action within the range of [-A, A] to actual action. We define negative actual + action as discharge resource from vessel to port and positive action as upload from port to vessel, so the upper bound and lower bound of actual action are the resource in dynamic and static node respectively. Args: @@ -26,15 +25,15 @@ def __call__(self, pending_action, model_action): model_action -= self._zero_action action_scope = pending_action.action_scope - + if model_action < 0: - # Discharge resource from dynamic node - env_action = round(int(model_action) * 1.0/self._zero_action * action_scope.load) + # Discharge resource from dynamic node. + env_action = round(int(model_action) * 1.0 / self._zero_action * action_scope.load) elif model_action == 0: - env_action =0 + env_action = 0 else: - # Load resource to dynamic node - env_action = round(int(model_action) * 1.0/self._zero_action * action_scope.discharge) + # Load resource to dynamic node. + env_action = round(int(model_action) * 1.0 / self._zero_action * action_scope.discharge) env_action = int(env_action) return env_action diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 3da100f67..f23b0078e 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -1,9 +1,9 @@ import ctypes -from collections import defaultdict, OrderedDict import multiprocessing -from multiprocessing import Process, Pipe, Event, Manager import numpy as np import time, os, pickle +from collections import defaultdict, OrderedDict +from multiprocessing import Process, Pipe, Event, Manager import torch @@ -11,6 +11,7 @@ from maro.simulator import Env from maro.simulator.scenarios.cim.common import Action, DecisionEvent from maro.utils import Logger, LogFormat, convert_dottable + from examples.cim.gnn.actor_critic import ActorCritic from examples.cim.gnn.action_shaper import DiscreteActionShaper from examples.cim.gnn.utils import fix_seed, gnn_union @@ -24,21 +25,21 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): """The function assemble the experience from multiple processes into a dictionary. Args: - experience_collections (dict): It stores the experience in all agents. The structure is the same as what is - defined in the SharedStructure in the ParallelActor except additional key for experience length. For + experience_collections (dict): It stores the experience in all agents. The structure is the same as what is + defined in the SharedStructure in the ParallelActor except additional key for experience length. For example: { - 'len': numpy.array, - 's': { - 'v': numpy.array, - 'p': numpy.array, + "len": numpy.array, + "s": { + "v": numpy.array, + "p": numpy.array, } - 'a': numpy.array, - 'R': numpy.array, - 's_': { - 'v': numpy.array, - 'p': numpy.array, + "a": numpy.array, + "R": numpy.array, + "s_": { + "v": numpy.array, + "p": numpy.array, } } @@ -46,27 +47,27 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): example, if agent x starts at b_x in batch index and the experience is l_x length long, the range [b_x, l_x) in the batch is the experience of agent x. - idx_mapping (dict): The key is the name of each agent and the value is the starting index, e.g., b_x, of the + idx_mapping (dict): The key is the name of each agent and the value is the starting index, e.g., b_x, of the storage space where the experience of the agent is stored. """ result = {} tmpi = 0 for code, idx in idx_mapping.items(): - exp_len = experience_collections['len'][0][tmpi] + exp_len = experience_collections["len"][0][tmpi] - s = organize_obs(experience_collections['s'], idx, exp_len) - s_ = organize_obs(experience_collections['s_'], idx, exp_len) - R = experience_collections['R'][idx:idx+exp_len] + s = organize_obs(experience_collections["s"], idx, exp_len) + s_ = organize_obs(experience_collections["s_"], idx, exp_len) + R = experience_collections["R"][idx:idx+exp_len] R = R.reshape(-1, *R.shape[2:]) - a = experience_collections['a'][idx:idx+exp_len] + a = experience_collections["a"][idx:idx+exp_len] a = a.reshape(-1, *a.shape[2:]) result[code] = { - 'R': R, - 'a': a, - 's': s, - 's_': s_, - 'len': a.shape[0] + "R": R, + "a": a, + "s": s, + "s_": s_, + "len": a.shape[0] } tmpi += 1 return result @@ -74,30 +75,30 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): def organize_obs(obs, idx, exp_len): """Helper function to transform the observation from multiple processes to a unified dictionary. """ - tick_buffer, _, para_cnt, v_cnt, v_dim = obs['v'].shape - _, _, _, p_cnt, p_dim = obs['p'].shape + tick_buffer, _, para_cnt, v_cnt, v_dim = obs["v"].shape + _, _, _, p_cnt, p_dim = obs["p"].shape batch = exp_len * para_cnt # v: tick_buffer, seq_len, parallel_cnt, v_cnt, v_dim --> (tick_buffer, cnt, v_cnt, v_dim) - v = obs['v'][:, idx: idx+exp_len] + v = obs["v"][:, idx: idx+exp_len] v = v.reshape(tick_buffer, batch, v_cnt, v_dim) - p = obs['p'][:, idx: idx+exp_len] + p = obs["p"][:, idx: idx+exp_len] p = p.reshape(tick_buffer, batch, p_cnt, p_dim) # vo: seq_len * parallel_cnt * v_cnt * p_cnt* --> cnt * v_cnt * p_cnt* - vo = obs['vo'][idx: idx+exp_len] + vo = obs["vo"][idx: idx+exp_len] vo = vo.reshape(batch, v_cnt, vo.shape[-1]) - po = obs['po'][idx: idx+exp_len] + po = obs["po"][idx: idx+exp_len] po = po.reshape(batch, p_cnt, po.shape[-1]) - vedge = obs['vedge'][idx: idx+exp_len] + vedge = obs["vedge"][idx: idx+exp_len] vedge = vedge.reshape(batch, v_cnt, vedge.shape[-2], vedge.shape[-1]) - pedge = obs['pedge'][idx: idx+exp_len] + pedge = obs["pedge"][idx: idx+exp_len] pedge = pedge.reshape(batch, p_cnt, pedge.shape[-2], pedge.shape[-1]) - ppedge = obs['ppedge'][idx: idx+exp_len] + ppedge = obs["ppedge"][idx: idx+exp_len] ppedge = ppedge.reshape(batch, p_cnt, ppedge.shape[-2], ppedge.shape[-1]) # mask: (seq_len, parallel_cnt, tick_buffer) - mask = obs['mask'][idx: idx+exp_len].reshape(batch, tick_buffer) + mask = obs["mask"][idx: idx+exp_len].reshape(batch, tick_buffer) - return {'v': v, 'p': p, 'vo': vo, 'po': po, 'pedge': pedge, 'vedge': vedge, 'ppedge': ppedge, 'mask': mask} + return {"v": v, "p": p, "vo": vo, "po": po, "pedge": pedge, "vedge": vedge, "ppedge": ppedge, "mask": mask} @@ -111,61 +112,61 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou exp_idx_mapping (dict): The key is agent code and the value is the starting index where the experience is stored in the experience batch. pipe (Pipe): The pipe instance for communication with the main process. - action_io (SharedStructure): The shared memory to hold the state information that the main process uses to + action_io (SharedStructure): The shared memory to hold the state information that the main process uses to generate an action. exp_output (SharedStructure): The shared memory to transfer the experience list to the main process. """ env = Env(**config.env.param) fix_seed(env, config.env.seed) - static_code_list, dynamic_code_list = list(env.summary['node_mapping']['ports'].values()), \ - list(env.summary['node_mapping']['vessels'].values()) + static_code_list, dynamic_code_list = list(env.summary["node_mapping"]["ports"].values()), \ + list(env.summary["node_mapping"]["vessels"].values()) # create gnn_state_shaper without consuming any resources - gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, + gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, config.model.feature, tick_buffer=config.model.tick_buffer, - max_value=env.configs['total_containers']) + max_value=env.configs["total_containers"]) gnn_state_shaper.compute_static_graph_structure(env) action_io_np = action_io.structuralize() action_shaper = DiscreteActionShaper(config.model.action_dim) - exp_shaper = ExperienceShaper(static_code_list, dynamic_code_list, config.env.param.durations, gnn_state_shaper, - scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, - discount_factor=config.training.gamma, idx=index, + exp_shaper = ExperienceShaper(static_code_list, dynamic_code_list, config.env.param.durations, gnn_state_shaper, + scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, + discount_factor=config.training.gamma, idx=index, shared_storage=exp_output.structuralize(), exp_idx_mapping=exp_idx_mapping) i = 0 - while pipe.recv() == 'reset': + while pipe.recv() == "reset": env.reset() r, pa, is_done = env.step(None) j = 0 - + logs = [] while not is_done: model_input = gnn_state_shaper(pa, env.snapshot_list) - action_io_np['v'][:, index] = model_input['v'] - action_io_np['p'][:, index] = model_input['p'] - action_io_np['vo'][index] = model_input['vo'] - action_io_np['po'][index] = model_input['po'] - action_io_np['vedge'][index] = model_input['vedge'] - action_io_np['pedge'][index] = model_input['pedge'] - action_io_np['ppedge'][index] = model_input['ppedge'] - action_io_np['mask'][index] = model_input['mask'] - action_io_np['pid'][index] = pa.port_idx - action_io_np['vid'][index] = pa.vessel_idx - pipe.send('features') + action_io_np["v"][:, index] = model_input["v"] + action_io_np["p"][:, index] = model_input["p"] + action_io_np["vo"][index] = model_input["vo"] + action_io_np["po"][index] = model_input["po"] + action_io_np["vedge"][index] = model_input["vedge"] + action_io_np["pedge"][index] = model_input["pedge"] + action_io_np["ppedge"][index] = model_input["ppedge"] + action_io_np["mask"][index] = model_input["mask"] + action_io_np["pid"][index] = pa.port_idx + action_io_np["vid"][index] = pa.vessel_idx + pipe.send("features") model_action = pipe.recv() env_action = action_shaper(pa, model_action) exp_shaper.record(pending_action=pa, model_action=model_action, model_input=model_input) - logs.append([index, pa.tick, pa.port_idx, pa.vessel_idx, model_action, env_action, pa.action_scope.load, + logs.append([index, pa.tick, pa.port_idx, pa.vessel_idx, model_action, env_action, pa.action_scope.load, pa.action_scope.discharge]) action = Action(pa.vessel_idx, pa.port_idx, env_action) r, pa, is_done = env.step(action) j += 1 - action_io_np['sh'][index] = compute_shortage(env.snapshot_list, config.env.param.durations, static_code_list) - # print('one ep done!') + action_io_np["sh"][index] = compute_shortage(env.snapshot_list, config.env.param.durations, static_code_list) + # print("one ep done!") i += 1 - pipe.send('done') + pipe.send("done") gnn_state_shaper.end_ep_callback(env.snapshot_list) # organize and synchronize exp to shared memory exp_shaper(env.snapshot_list) @@ -173,7 +174,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou logs = np.array(logs, dtype=np.float) pipe.send(logs) - print('the end') + print("the end") def compute_shortage(snapshot_list, max_tick, static_code_list): """Helper function to compute the shortage after a episode end. @@ -184,90 +185,90 @@ class ParallelActor(AbsActor): def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): """A2C rollout class. - This implements the synchronized A2C structure. Multiple processes are created to simulate and collect - experience where only CPU is needed and whenever an action is required, they notify the main process and the + This implements the synchronized A2C structure. Multiple processes are created to simulate and collect + experience where only CPU is needed and whenever an action is required, they notify the main process and the main process will do the batch action inference with GPU. Args: config (dict): The configuration to run the simulation. - demo_env (maro.simulator.Env): To get configuration information such as the amount of vessels and ports as + demo_env (maro.simulator.Env): To get configuration information such as the amount of vessels and ports as well as the topology of the environment, the example environment is needed. - gnn_state_shaper (AbsShaper): The state shaper instance to extract graph information from the state of + gnn_state_shaper (AbsShaper): The state shaper instance to extract graph information from the state of the environment. agent_manager (AbsAgentManger): The agent manager instance to do the action inference in batch. logger: The logger instance to log information during the rollout. """ super().__init__(demo_env, agent_manager) - multiprocessing.set_start_method('spawn', True) + multiprocessing.set_start_method("spawn", True) self._logger = logger self.config = config - self._static_node_mapping = demo_env.summary['node_mapping']['ports'] - self._dynamic_node_mapping = demo_env.summary['node_mapping']['vessels'] + self._static_node_mapping = demo_env.summary["node_mapping"]["ports"] + self._dynamic_node_mapping = demo_env.summary["node_mapping"]["vessels"] self._gnn_state_shaper = gnn_state_shaper self.device = torch.device(config.training.device) self.parallel_cnt = config.training.parallel_cnt - self.log_header = ['sh_%d'%i for i in range(self.parallel_cnt)] + self.log_header = ["sh_%d"%i for i in range(self.parallel_cnt)] tick_buffer = config.model.tick_buffer action_dim = config.model.action_dim - v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim('v'), \ - self._gnn_state_shaper.get_input_dim('vedge'), len(self._dynamic_node_mapping) - p_dim, pedge_dim, p_cnt = self._gnn_state_shaper.get_input_dim('p'), \ - self._gnn_state_shaper.get_input_dim('pedge'), len(self._static_node_mapping) + v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim("v"), \ + self._gnn_state_shaper.get_input_dim("vedge"), len(self._dynamic_node_mapping) + p_dim, pedge_dim, p_cnt = self._gnn_state_shaper.get_input_dim("p"), \ + self._gnn_state_shaper.get_input_dim("pedge"), len(self._static_node_mapping) self.pipes = [Pipe() for i in range(self.parallel_cnt)] action_io_structure = { - 'p': ((tick_buffer, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), - 'v': ((tick_buffer, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), - 'po': ((self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), - 'vo': ((self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), - 'vedge': ((self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), - 'pedge': ((self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), - 'ppedge': ((self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), - 'mask': ((self.parallel_cnt, tick_buffer), ctypes.c_bool), - 'sh': ((self.parallel_cnt, ), ctypes.c_long), - 'pid': ((self.parallel_cnt, ), ctypes.c_long), - 'vid': ((self.parallel_cnt, ), ctypes.c_long) + "p": ((tick_buffer, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), + "v": ((tick_buffer, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), + "po": ((self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), + "vo": ((self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), + "vedge": ((self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), + "pedge": ((self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), + "ppedge": ((self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), + "mask": ((self.parallel_cnt, tick_buffer), ctypes.c_bool), + "sh": ((self.parallel_cnt, ), ctypes.c_long), + "pid": ((self.parallel_cnt, ), ctypes.c_long), + "vid": ((self.parallel_cnt, ), ctypes.c_long) } self.action_io = SharedStructure(action_io_structure) self.action_io_np = self.action_io.structuralize() tot_exp_len = sum(config.env.exp_per_ep.values()) - + exp_output_structure = { - 's': { - 'v': ((tick_buffer, tot_exp_len, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), - 'p': ((tick_buffer, tot_exp_len, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), - 'vo': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), - 'po': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), - 'vedge': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), - 'pedge': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), - 'ppedge': ((tot_exp_len, self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), - 'mask': ((tot_exp_len, self.parallel_cnt, tick_buffer), ctypes.c_bool) + "s": { + "v": ((tick_buffer, tot_exp_len, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), + "p": ((tick_buffer, tot_exp_len, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), + "vo": ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), + "po": ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), + "vedge": ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), + "pedge": ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), + "ppedge": ((tot_exp_len, self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), + "mask": ((tot_exp_len, self.parallel_cnt, tick_buffer), ctypes.c_bool) }, - 's_': { - 'v': ((tick_buffer, tot_exp_len, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), - 'p': ((tick_buffer, tot_exp_len, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), - 'vo': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), - 'po': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), - 'vedge': ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), - 'pedge': ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), - 'ppedge': ((tot_exp_len, self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), - 'mask': ((tot_exp_len, self.parallel_cnt, tick_buffer), ctypes.c_bool) + "s_": { + "v": ((tick_buffer, tot_exp_len, self.parallel_cnt, v_cnt, v_dim), ctypes.c_float), + "p": ((tick_buffer, tot_exp_len, self.parallel_cnt, p_cnt, p_dim), ctypes.c_float), + "vo": ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt), ctypes.c_long), + "po": ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt), ctypes.c_long), + "vedge": ((tot_exp_len, self.parallel_cnt, v_cnt, p_cnt, vedge_dim), ctypes.c_float), + "pedge": ((tot_exp_len, self.parallel_cnt, p_cnt, v_cnt, vedge_dim), ctypes.c_float), + "ppedge": ((tot_exp_len, self.parallel_cnt, p_cnt, p_cnt, pedge_dim), ctypes.c_float), + "mask": ((tot_exp_len, self.parallel_cnt, tick_buffer), ctypes.c_bool) }, - 'a': ((tot_exp_len, self.parallel_cnt), ctypes.c_long), - 'len': ((self.parallel_cnt, len(config.env.exp_per_ep)), ctypes.c_long), - 'R': ((tot_exp_len, self.parallel_cnt, p_cnt), ctypes.c_float), + "a": ((tot_exp_len, self.parallel_cnt), ctypes.c_long), + "len": ((self.parallel_cnt, len(config.env.exp_per_ep)), ctypes.c_long), + "R": ((tot_exp_len, self.parallel_cnt, p_cnt), ctypes.c_float), } self.exp_output = SharedStructure(exp_output_structure) self.exp_output_np = self.exp_output.structuralize() - self._logger.info('allocate complete') + self._logger.info("allocate complete") self.exp_idx_mapping = OrderedDict() acc_c = 0 @@ -282,7 +283,7 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): for w in self.workers: w.start() - self._logger.info('all thread started') + self._logger.info("all thread started") self._roll_out_time = 0 self._trainsfer_time = 0 @@ -299,71 +300,71 @@ def roll_out(self): t_state = 0 # compute the time used for action inference. t_action = 0 - + for p in self.pipes: - p[0].send('reset') + p[0].send("reset") self._roll_out_cnt += 1 step_i = 0 tick = time.time() while True: signals = [p[0].recv() for p in self.pipes] - if signals[0] == 'done': + if signals[0] == "done": break - # print('step: %d'%step_i) + # print("step: %d"%step_i) step_i += 1 t = time.time() - graph = gnn_union(self.action_io_np['p'], self.action_io_np['po'], self.action_io_np['pedge'], - self.action_io_np['v'], self.action_io_np['vo'], self.action_io_np['vedge'], - self._gnn_state_shaper.p2p_static_graph, self.action_io_np['ppedge'], - self.action_io_np['mask'], self.device) + graph = gnn_union(self.action_io_np["p"], self.action_io_np["po"], self.action_io_np["pedge"], + self.action_io_np["v"], self.action_io_np["vo"], self.action_io_np["vedge"], + self._gnn_state_shaper.p2p_static_graph, self.action_io_np["ppedge"], + self.action_io_np["mask"], self.device) t_state += time.time() - t - # print(self.action_io_np['pid']) - assert(np.min(self.action_io_np['pid']) == np.max(self.action_io_np['pid'])) - assert(np.min(self.action_io_np['vid']) == np.max(self.action_io_np['vid'])) + # print(self.action_io_np["pid"]) + assert(np.min(self.action_io_np["pid"]) == np.max(self.action_io_np["pid"])) + assert(np.min(self.action_io_np["vid"]) == np.max(self.action_io_np["vid"])) t = time.time() - actions = self._inference_agents.choose_action(agent_id = (self.action_io_np['pid'][0], - self.action_io_np['vid'][0]), state=graph) + actions = self._inference_agents.choose_action(agent_id = (self.action_io_np["pid"][0], + self.action_io_np["vid"][0]), state=graph) t_action += time.time() - t for i, p in enumerate(self.pipes): p[0].send(actions[i]) self._roll_out_time += time.time() - tick - # print(self.exp_output_np['len']) + # print(self.exp_output_np["len"]) tick = time.time() - self._logger.info('receiving exp') + self._logger.info("receiving exp") logs = [p[0].recv() for p in self.pipes] - - self._logger.info("Mean of shortage: %f" % np.mean(self.action_io_np['sh'])) + + self._logger.info("Mean of shortage: %f" % np.mean(self.action_io_np["sh"])) self._trainsfer_time += time.time() - tick - self._logger.debug(dict(zip(self.log_header, self.action_io_np['sh']))) + self._logger.debug(dict(zip(self.log_header, self.action_io_np["sh"]))) # print(loged_dict) - with open(os.path.join(self.config.log.path, 'logs_%d'%self._roll_out_cnt), 'wb') as fp: + with open(os.path.join(self.config.log.path, "logs_%d"%self._roll_out_cnt), "wb") as fp: pickle.dump(logs, fp) - self._logger.info('organize exp_dict') + self._logger.info("organize exp_dict") result = organize_exp_list(self.exp_output_np, self.exp_idx_mapping) - + if self.config.log.exp.enable and self._roll_out_cnt % self.config.log.exp.freq == 0: - with open(os.path.join(self.config.log.path, 'exp_%d'%self._roll_out_cnt), 'wb') as fp: + with open(os.path.join(self.config.log.path, "exp_%d"%self._roll_out_cnt), "wb") as fp: pickle.dump(result, fp) - self._logger.debug('play time: %d' % int(self._roll_out_time)) - self._logger.debug('transfer time: %d' % int(self._trainsfer_time)) + self._logger.debug("play time: %d" % int(self._roll_out_time)) + self._logger.debug("transfer time: %d" % int(self._trainsfer_time)) return result def exit(self): """Terminate the child processes. """ for p in self.pipes: - p[0].send('close') + p[0].send("close") diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index d7e88f058..b0f65a1ca 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -6,6 +6,7 @@ from torch.nn.utils import clip_grad from maro.rl import AbsAlgorithm + from examples.cim.gnn.utils import gnn_union class ActorCritic(AbsAlgorithm): @@ -17,18 +18,18 @@ class ActorCritic(AbsAlgorithm): model (nn.Module): A actor-critic module outputing both the policy network and the value network. device (torch.device): A PyTorch device instance where the module is computed on. p2p_adj (numpy.array): The static port-to-port adjencency matrix. - td_steps (int): The value 'n' in the n-step TD algorithm. + td_steps (int): The value "n" in the n-step TD algorithm. gamma (float): The time decay. learning_rate (float): The learning rate for the module. - entropy_factor (float): The weight of the policy's entropy to boost exploration. + entropy_factor (float): The weight of the policy"s entropy to boost exploration. """ def __init__(self, model: nn.Module, device: torch.device, - p2p_adj=None, - td_steps=100, - gamma=0.97, - learning_rate=0.0003, + p2p_adj=None, + td_steps=100, + gamma=0.97, + learning_rate=0.0003, entropy_factor=0.1): self._gamma = gamma self._td_steps = td_steps @@ -37,7 +38,7 @@ def __init__(self, model: nn.Module, self._device = device self._tot_batchs = 0 self._p2p_adj = p2p_adj - super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, + super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, loss_func_dict={}, hyper_params=None) @@ -47,28 +48,28 @@ def choose_action(self, state: dict, p_idx: int, v_idx: int): Args: state (dict): A dictionary containing the input to the module. For example: { - 'v': v, - 'p': p, - 'pe': { - 'edge': pedge, - 'adj': padj, - 'mask': pmask, + "v": v, + "p": p, + "pe": { + "edge": pedge, + "adj": padj, + "mask": pmask, }, - 've': { - 'edge': vedge, - 'adj': vadj, - 'mask': vmask, + "ve": { + "edge": vedge, + "adj": vadj, + "mask": vmask, }, - 'ppe': { - 'edge': ppedge, - 'adj': p2p_adj, - 'mask': p2p_mask, + "ppe": { + "edge": ppedge, + "adj": p2p_adj, + "mask": p2p_mask, }, - 'mask': seq_mask, + "mask": seq_mask, } p_idx (int): The identity of the port doing the action. v_idx (int): The identity of the vessel doing the action. - + Returns: model_action (numpy.int64): The action returned from the module. """ @@ -84,14 +85,14 @@ def train(self, batch, p_idx, v_idx): Args: batch (dict): The dictionary of a batch of experience. For example: { - 's': the dictionary of state, - 'a': model actions in numpy array, - 'R': the n-step accumulated reward, - 's'': the dictionary of the next state, + "s": the dictionary of state, + "a": model actions in numpy array, + "R": the n-step accumulated reward, + "s"": the dictionary of the next state, } p_idx (int): The identity of the port doing the action. v_idx (int): The identity of the vessel doing the action. - + Returns: a_loss (float): action loss. c_loss (float): critic loss. @@ -101,19 +102,19 @@ def train(self, batch, p_idx, v_idx): """ self._tot_batchs += 1 item_a_loss, item_c_loss, item_e_loss = 0, 0, 0 - obs_batch = batch['s'] - action_batch = batch['a'] - return_batch = batch['R'] - next_obs_batch = batch['s_'] - - obs_batch = gnn_union(obs_batch['p'], obs_batch['po'], obs_batch['pedge'], obs_batch['v'], - obs_batch['vo'], obs_batch['vedge'], self._p2p_adj, obs_batch['ppedge'], - obs_batch['mask'], self._device) + obs_batch = batch["s"] + action_batch = batch["a"] + return_batch = batch["R"] + next_obs_batch = batch["s_"] + + obs_batch = gnn_union(obs_batch["p"], obs_batch["po"], obs_batch["pedge"], obs_batch["v"], + obs_batch["vo"], obs_batch["vedge"], self._p2p_adj, obs_batch["ppedge"], + obs_batch["mask"], self._device) action_batch = torch.from_numpy(action_batch).long().to(self._device) return_batch = torch.from_numpy(return_batch).float().to(self._device) - next_obs_batch = gnn_union(next_obs_batch['p'], next_obs_batch['po'], next_obs_batch['pedge'], - next_obs_batch['v'], next_obs_batch['vo'], next_obs_batch['vedge'], - self._p2p_adj, next_obs_batch['ppedge'], next_obs_batch['mask'], + next_obs_batch = gnn_union(next_obs_batch["p"], next_obs_batch["po"], next_obs_batch["pedge"], + next_obs_batch["v"], next_obs_batch["vo"], next_obs_batch["vedge"], + self._p2p_adj, next_obs_batch["ppedge"], next_obs_batch["mask"], self._device) # train actor network @@ -140,7 +141,7 @@ def train(self, batch, p_idx, v_idx): # actor_loss.backward(retain_graph=True) # self._actor_optimizer["a&c"].step() - + item_a_loss = actor_loss.item() item_e_loss = entropy_loss.mean().item() @@ -163,14 +164,14 @@ def get_weights(self): return self._model_dict["a&c"].state_dict() def _get_save_idx(self, fp_str): - return int(fp_str.split('.')[0].split('_')[0]) + return int(fp_str.split(".")[0].split("_")[0]) def save_model(self, pth, id): if not os.path.exists(pth): os.makedirs(pth) - pth = os.path.join(pth, '%d_ac.pkl'%id) + pth = os.path.join(pth, "%d_ac.pkl"%id) torch.save(self._model_dict["a&c"].state_dict(), pth) - + def _set_gnn_weights(self, weights): for key in weights: if key in self._model_dict["a&c"].state_dict().keys(): @@ -179,12 +180,12 @@ def _set_gnn_weights(self, weights): def load_model(self, folder_pth, idx=-1): if idx == -1: fps = os.listdir(folder_pth) - fps = [f for f in fps if 'ac' in f] + fps = [f for f in fps if "ac" in f] fps.sort(key=self._get_save_idx) ac_pth = fps[-1] else: - ac_pth = '%d_ac.pkl'%idx + ac_pth = "%d_ac.pkl"%idx pth = os.path.join(folder_pth, ac_pth) - with open(pth, 'rb') as fp: + with open(pth, "rb") as fp: weights = torch.load(fp, map_location=self._device) - self._set_gnn_weights(weights) \ No newline at end of file + self._set_gnn_weights(weights) diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index d8dac2a90..68ab0f80d 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -18,26 +18,25 @@ def train(self, training_config): shuffler = Shuffler(self._experience_pool, batch_size=training_config.batch_size) while shuffler.has_next(): batch = shuffler.next() - actor_loss, critic_loss, entropy_loss, tot_loss = self._algorithm.train(batch, self._name[0], + actor_loss, critic_loss, entropy_loss, tot_loss = self._algorithm.train(batch, self._name[0], self._name[1]) - loss_dict['actor'].append(actor_loss) - loss_dict['critic'].append(critic_loss) - loss_dict['entropy'].append(entropy_loss) - loss_dict['tot'].append(tot_loss) + loss_dict["actor"].append(actor_loss) + loss_dict["critic"].append(critic_loss) + loss_dict["entropy"].append(entropy_loss) + loss_dict["tot"].append(tot_loss) - a_loss = np.mean(loss_dict['actor']) - c_loss = np.mean(loss_dict['critic']) - e_loss = np.mean(loss_dict['entropy']) - tot_loss = np.mean(loss_dict['tot']) - self._logger.debug('code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f'%(str(self._name), + a_loss = np.mean(loss_dict["actor"]) + c_loss = np.mean(loss_dict["critic"]) + e_loss = np.mean(loss_dict["entropy"]) + tot_loss = np.mean(loss_dict["tot"]) + self._logger.debug("code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f"%(str(self._name), float(a_loss), float(c_loss), float(e_loss), float(tot_loss))) - + self._experience_pool.clear() return loss_dict - + def choose_action(self, model_state): return self._algorithm.choose_action(model_state, self._name[0], self._name[1]) - \ No newline at end of file diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index d2008cd8a..a61cef20c 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -11,19 +11,19 @@ import torch class SimpleAgentManger(AbsAgentManager): - def __init__(self, name, - agent_id_list, + def __init__(self, name, + agent_id_list, port_code_list, vessel_code_list, demo_env, state_shaper:GNNStateShaper, logger=DummyLogger()): - super().__init__(name, - AgentMode.TRAIN, - agent_id_list, - state_shaper=state_shaper, - action_shaper=None, - experience_shaper=None, + super().__init__(name, + AgentMode.TRAIN, + agent_id_list, + state_shaper=state_shaper, + action_shaper=None, + experience_shaper=None, explorer=None) self.port_code_list = copy(port_code_list) self.vessel_code_list = copy(vessel_code_list) @@ -31,39 +31,39 @@ def __init__(self, name, self._logger = logger def assemble(self, config): - v_dim, vedge_dim, v_cnt = self._state_shaper.get_input_dim('v'), self._state_shaper.get_input_dim('vedge'), len(self.vessel_code_list) - p_dim, pedge_dim, p_cnt = self._state_shaper.get_input_dim('p'), self._state_shaper.get_input_dim('pedge'), len(self.port_code_list) + v_dim, vedge_dim, v_cnt = self._state_shaper.get_input_dim("v"), self._state_shaper.get_input_dim("vedge"), len(self.vessel_code_list) + p_dim, pedge_dim, p_cnt = self._state_shaper.get_input_dim("p"), self._state_shaper.get_input_dim("pedge"), len(self.port_code_list) self.device = torch.device(config.training.device) self._logger.info(config.training.device) ac_model = SharedAC(p_dim, pedge_dim, v_dim, vedge_dim, config.model.tick_buffer, config.model.action_dim).to(self.device) value_dict = { - ('s', 'v'): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim('v')), np.float32, False), - ('s', 'p'): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim('p')), np.float32, False), - ('s', 'vo'): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), - ('s', 'po'): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), - ('s', 'vedge'): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), - ('s', 'pedge'): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), - ('s', 'ppedge'): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('pedge')), np.float32, True), - ('s', 'mask'): ((config.model.tick_buffer, ), np.bool, True), + ("s", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), np.float32, False), + ("s", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), np.float32, False), + ("s", "vo"): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), + ("s", "po"): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), + ("s", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("pedge")), np.float32, True), + ("s", "mask"): ((config.model.tick_buffer, ), np.bool, True), - ('s_', 'v'): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim('v')), np.float32, False), - ('s_', 'p'): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim('p')), np.float32, False), - ('s_', 'vo'): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), - ('s_', 'po'): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), - ('s_', 'vedge'): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), - ('s_', 'pedge'): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim('vedge')), np.float32, True), - ('s_', 'ppedge'): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim('pedge')), np.float32, True), - ('s_', 'mask'): ((config.model.tick_buffer, ), np.bool, True), + ("s_", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), np.float32, False), + ("s_", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), np.float32, False), + ("s_", "vo"): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), + ("s_", "po"): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), + ("s_", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s_", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s_", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("pedge")), np.float32, True), + ("s_", "mask"): ((config.model.tick_buffer, ), np.bool, True), # to identify one dimension variable - ('R',): ((len(self.port_code_list), ), np.float32, True), - ('a',): (tuple(), np.int64, True), + ("R",): ((len(self.port_code_list), ), np.float32, True), + ("a",): (tuple(), np.int64, True), } - self._algorithm = ActorCritic(ac_model, self.device, td_steps=config.training.td_steps, - p2p_adj=self._state_shaper.p2p_static_graph, gamma=config.training.gamma, + self._algorithm = ActorCritic(ac_model, self.device, td_steps=config.training.td_steps, + p2p_adj=self._state_shaper.p2p_static_graph, gamma=config.training.gamma, learning_rate=config.training.learning_rate) for agent_id, cnt in config.env.exp_per_ep.items(): @@ -79,7 +79,7 @@ def load_models_from_files(self, model_pth): def train(self, training_config): for agent in self._agent_dict.values(): agent.train(training_config) - + def store_experiences(self, experiences): for code, exp_list in experiences.items(): self._agent_dict[code].store_experiences(exp_list) @@ -88,4 +88,4 @@ def save_model(self, pth, id): self._algorithm.save_model(pth, id) def load_model(self, pth): - self._algorithm.load_model(pth) \ No newline at end of file + self._algorithm.load_model(pth) diff --git a/examples/cim/gnn/config.yml b/examples/cim/gnn/config.yml index a06dd17f4..532fc8f0f 100644 --- a/examples/cim/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -3,12 +3,12 @@ env: param: durations: 750 scenario: "cim" - topology: 'global_trade.22p_l0.1' + topology: "global_trade.22p_l0.1" # topology: "toy.4p_ssdd_l0.0" training: enable: True parallel_cnt: 24 - device: 'cuda:0' + device: "cuda:0" batch_size: 150 shuffle_time: 1 rollout_cnt: 1000 @@ -19,19 +19,18 @@ training: td_steps: 100 entropy_loss_enable: True model: - # path: '/data/log/20200119/demo_6p' - path: '/dcdata/log/test' + path: "./" tick_buffer: 20 hidden_size: 32 graph_output_dim: 32 action_dim: 21 feature: - # temporal or random, if temporal, the edges in the graph are listed in the order of event time, else in a + # temporal or random, if temporal, the edges in the graph are listed in the order of event time, else in a # random order. - attention_order: temporal + attention_order: temporal onehot_identity: False log: - path: /dcdata/log/ + path: "./" # be careful to turn this on snapshot: True exp: diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index d1acec206..cdb5426f7 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -2,7 +2,7 @@ from collections import defaultdict class ExperienceShaper: - def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, + def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, discount_factor=0.97, idx=-1, shared_storage=None, exp_idx_mapping=None): self._static_list = list(static_list) self._dynamic_list = list(dynamic_list) @@ -30,9 +30,9 @@ def record(self, pending_action, model_action, model_input): # only the experience that has the next state of given time slot is valuable if pending_action.tick + self._time_slot < self._max_tick: self._experience_dict[pending_action.port_idx, pending_action.vessel_idx].append({ - 'tick': pending_action.tick, - 's': model_input, - 'a': model_action, + "tick": pending_action.tick, + "s": model_input, + "a": model_action, }) def _compute_delta(self, arr): @@ -41,16 +41,16 @@ def _compute_delta(self, arr): return delta def _batch_obs_to_numpy(self, obs): - v = np.stack([o['v'] for o in obs], axis=0) - p = np.stack([o['p'] for o in obs], axis=0) - vo = np.stack([o['vo'] for o in obs], axis=0) - po = np.stack([o['po'] for o in obs], axis=0) - return {'p': p, 'v': v, 'vo': vo, 'po': po} - + v = np.stack([o["v"] for o in obs], axis=0) + p = np.stack([o["p"] for o in obs], axis=0) + vo = np.stack([o["vo"] for o in obs], axis=0) + po = np.stack([o["po"] for o in obs], axis=0) + return {"p": p, "v": v, "vo": vo, "po": po} + def __call__(self, snapshot_list): if self._shared_storage is None: return - + shortage = snapshot_list["ports"][self._tick_range:self._static_list:"shortage"].reshape(self._max_tick, -1) fulfillment = snapshot_list["ports"][self._tick_range:self._static_list:"fulfillment"] \ .reshape(self._max_tick, -1) @@ -61,13 +61,13 @@ def __call__(self, snapshot_list): for i in range(0, self._len_return, 1): R[i] = np.dot(self._discount_vector, delta[i+1: i+self._time_slot+1]) - # pkl.dump(R, open(r'/data/log/replay/R2.pkl', 'wb')) + # pkl.dump(R, open(r"/data/log/replay/R2.pkl", "wb")) for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): for exp in exp_list: - tick = exp['tick'] - exp['s_'] = self._gnn_state_shaper(tick=tick+self._time_slot) - exp['R'] = self._scale_factor*R[tick] + tick = exp["tick"] + exp["s_"] = self._gnn_state_shaper(tick=tick+self._time_slot) + exp["R"] = self._scale_factor*R[tick] tmpi = 0 for (agent_idx, vessel_idx), idx_base in self._exp_idx_mapping.items(): @@ -75,40 +75,40 @@ def __call__(self, snapshot_list): exp_list = self._experience_dict[(agent_idx, vessel_idx)] exp_len = len(exp_list) # here, we assume that exp_idx_mapping order is not changed. - self._shared_storage['len'][self._idx, tmpi] = exp_len - self._shared_storage['s']['v'][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s']['v'] for e in exp_list], axis=1) - self._shared_storage['s']['p'][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s']['p'] for e in exp_list], axis=1) - self._shared_storage['s']['vo'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s']['vo'] for e in exp_list], axis=0) - self._shared_storage['s']['po'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s']['po'] for e in exp_list], axis=0) - self._shared_storage['s']['vedge'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s']['vedge'] for e in exp_list], axis=0) - self._shared_storage['s']['pedge'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s']['pedge'] for e in exp_list], axis=0) + self._shared_storage["len"][self._idx, tmpi] = exp_len + self._shared_storage["s"]["v"][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s"]["v"] for e in exp_list], axis=1) + self._shared_storage["s"]["p"][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s"]["p"] for e in exp_list], axis=1) + self._shared_storage["s"]["vo"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s"]["vo"] for e in exp_list], axis=0) + self._shared_storage["s"]["po"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s"]["po"] for e in exp_list], axis=0) + self._shared_storage["s"]["vedge"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s"]["vedge"] for e in exp_list], axis=0) + self._shared_storage["s"]["pedge"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s"]["pedge"] for e in exp_list], axis=0) - self._shared_storage['s_']['v'][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s_']['v'] for e in exp_list], axis=1) - self._shared_storage['s_']['p'][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s_']['p'] for e in exp_list], axis=1) - self._shared_storage['s_']['vo'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s_']['vo'] for e in exp_list], axis=0) - self._shared_storage['s_']['po'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s_']['po'] for e in exp_list], axis=0) - self._shared_storage['s_']['vedge'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s_']['vedge'] for e in exp_list], axis=0) - self._shared_storage['s_']['pedge'][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e['s_']['pedge'] for e in exp_list], axis=0) + self._shared_storage["s_"]["v"][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s_"]["v"] for e in exp_list], axis=1) + self._shared_storage["s_"]["p"][:, idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s_"]["p"] for e in exp_list], axis=1) + self._shared_storage["s_"]["vo"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s_"]["vo"] for e in exp_list], axis=0) + self._shared_storage["s_"]["po"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s_"]["po"] for e in exp_list], axis=0) + self._shared_storage["s_"]["vedge"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s_"]["vedge"] for e in exp_list], axis=0) + self._shared_storage["s_"]["pedge"][idx_base:idx_base+exp_len, self._idx] = \ + np.stack([e["s_"]["pedge"] for e in exp_list], axis=0) - self._shared_storage['a'][idx_base:idx_base+exp_len, self._idx] = \ - np.array([exp['a'] for exp in exp_list], dtype=np.int64) - self._shared_storage['R'][idx_base:idx_base+exp_len, self._idx] = np.vstack([exp['R'] for exp in exp_list]) + self._shared_storage["a"][idx_base:idx_base+exp_len, self._idx] = \ + np.array([exp["a"] for exp in exp_list], dtype=np.int64) + self._shared_storage["R"][idx_base:idx_base+exp_len, self._idx] = np.vstack([exp["R"] for exp in exp_list]) tmpi += 1 - - # pkl.dump(self._exp_idx_mapping, open(r'/data/log/replay/order2.pkl', 'wb')) - # pkl.dump(self._shared_storage, open(r'/data/log/replay/22p2.pkl', 'wb')) + + # pkl.dump(self._exp_idx_mapping, open(r"/data/log/replay/order2.pkl", "wb")) + # pkl.dump(self._shared_storage, open(r"/data/log/replay/22p2.pkl", "wb")) def reset(self): del self._experience_dict diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 34efcc44e..143198d7f 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -12,20 +12,20 @@ if __name__ == "__main__": - config_pth = 'examples/cim/gnn/config.yml' + config_pth = "examples/cim/gnn/config.yml" config = load_config(config_pth) # generate log path. - date_str = f"{datetime.datetime.now().strftime('%Y%m%d')}" - time_str = f"{datetime.datetime.now().strftime('%H%M%S.%f')}" - subfolder_name = '%s_%s'%(config.env.param.topology, time_str) + date_str = f"{datetime.datetime.now().strftime("%Y%m%d")}" + time_str = f"{datetime.datetime.now().strftime("%H%M%S.%f")}" + subfolder_name = "%s_%s"%(config.env.param.topology, time_str) # log path. config.log.path = os.path.join(config.log.path, date_str, subfolder_name) if not os.path.exists(config.log.path): os.makedirs(config.log.path) - simulation_logger = Logger(tag='simulation', dump_folder=config.log.path, dump_mode='w', auto_timestamp=False) + simulation_logger = Logger(tag="simulation", dump_folder=config.log.path, dump_mode="w", auto_timestamp=False) # create a demo environment to retrieve environment information. simulation_logger.info("Approximating the experience quantity of each agent...") @@ -34,27 +34,27 @@ simulation_logger.info(config.env.exp_per_ep) # add some buffer to prevent overlapping - config.env.return_scaler, tot_order_amount = return_scaler(demo_env, tick=config.env.param.durations, + config.env.return_scaler, tot_order_amount = return_scaler(demo_env, tick=config.env.param.durations, gamma=config.training.gamma) simulation_logger.info("Return value will be scaled down by the factor %f"%config.env.return_scaler) - save_config(config, os.path.join(config.log.path, 'config.yml')) - save_code('examples/cim/gnn',config.log.path) + save_config(config, os.path.join(config.log.path, "config.yml")) + save_code("examples/cim/gnn", config.log.path) - port_mapping = demo_env.summary['node_mapping']['ports'] - vessel_mapping = demo_env.summary['node_mapping']['vessels'] + port_mapping = demo_env.summary["node_mapping"]["ports"] + vessel_mapping = demo_env.summary["node_mapping"]["vessels"] # create a mock gnn_state_shaper. static_code_list, dynamic_code_list = list(port_mapping.values()), list(vessel_mapping.values()) - gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, - config.model.feature, tick_buffer=config.model.tick_buffer, only_demo=True, - max_value=demo_env.configs['total_containers']) + gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, + config.model.feature, tick_buffer=config.model.tick_buffer, only_demo=True, + max_value=demo_env.configs["total_containers"]) gnn_state_shaper.compute_static_graph_structure(demo_env) # create and assemble agent_manager agent_id_list = list(config.env.exp_per_ep.keys()) - training_logger = Logger(tag='training', dump_folder=config.log.path, dump_mode='w', auto_timestamp=False) - agent_manager = SimpleAgentManger("CIM-GNN-manager", agent_id_list, static_code_list, dynamic_code_list, demo_env, + training_logger = Logger(tag="training", dump_folder=config.log.path, dump_mode="w", auto_timestamp=False) + agent_manager = SimpleAgentManger("CIM-GNN-manager", agent_id_list, static_code_list, dynamic_code_list, demo_env, gnn_state_shaper, training_logger) agent_manager.assemble(config) @@ -69,4 +69,4 @@ learner.train(config.training) # cancel all the child process used for rollout. - actor.exit() \ No newline at end of file + actor.exit() diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index c06cd8cbb..dbf04ca2a 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -26,13 +26,13 @@ def train(self, training_config, log_pth=None): rollout_time = 0 training_time = 0 for i in range(training_config.rollout_cnt): - self._logger.info('rollout %d'%(i+1)) + self._logger.info("rollout %d"%(i+1)) tick = time.time() exp_dict = self._actor.roll_out() rollout_time += time.time() - tick - self._logger.info('start putting exps') + self._logger.info("start putting exps") self._trainable_agents.store_experiences(exp_dict) if training_config.enable and i % training_config.train_freq == training_config.train_freq-1: @@ -40,15 +40,15 @@ def train(self, training_config, log_pth=None): # for code, exp_pool in experience_pool_dict.items(): loss_dict = self._trainable_agents.train(training_config) - + training_time += time.time() - tick if log_pth is not None and (i+1) % training_config.model_save_freq == 0: - self._trainable_agents.save_model(os.path.join(log_pth, 'models'), i+1) + self._trainable_agents.save_model(os.path.join(log_pth, "models"), i+1) - self._logger.debug('total rollout_time: %d' % int(rollout_time)) - self._logger.debug('train_time: %d' % int(training_time)) + self._logger.debug("total rollout_time: %d" % int(rollout_time)) + self._logger.debug("train_time: %d" % int(training_time)) def test(self): - pass \ No newline at end of file + pass diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index fb5d90127..4ce30a8ff 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -6,20 +6,20 @@ def get_item(data_dict, key_tuple): """Helper function to get the value in a hierarchical dictionary given the key path. - + Args: data_dict (dict): The data structure. For example: { - 'a': { - 'b': 1, - 'c': { - 'd': 2, + "a": { + "b": 1, + "c": { + "d": 2, } } } - key_tuple (tuple): The key path to the target field. For example, given the data_dict above, the key_tuple - ('a', 'c', 'd') should return 2. + key_tuple (tuple): The key path to the target field. For example, given the data_dict above, the key_tuple + ("a", "c", "d") should return 2. """ for key in key_tuple: data_dict = data_dict[key] @@ -37,34 +37,34 @@ def set_item(data_dict, key_tuple, data): else: data_dict = data_dict[key] - + class NumpyStore(AbsStore): def __init__(self, domain_type_dict, capacity): """ Args: - domain_type_dict (dict): The dictionary describing the name, structure and type of each field in the + domain_type_dict (dict): The dictionary describing the name, structure and type of each field in the experience. Each field in the experience is the key-value pair in the folowing structure: (field_name): (size_of_an_instance, data_type, batch_first) For example: - ('s'): ((32, 64), np.float32, True) - + ("s"): ((32, 64), np.float32, True) + The field can be a hierarchical dictionary by identifying the full path to the root. For example: { - ('s', 'p'): ((32, 64), np.float32, True) - ('s', 'v'): ((48, ), np.float32, False), + ("s", "p"): ((32, 64), np.float32, True) + ("s", "v"): ((48, ), np.float32, False), } Then the batch of experience returned by self.get(indexes) is: { - 's': + "s": { - 'p': numpy.array with size (batch, 32, 64), - 'v': numpy.array with size (32, batch, 48), + "p": numpy.array with size (batch, 32, 64), + "v": numpy.array with size (32, batch, 48), } } - Note that for the field ('s', 'v'), the batch is in the 2nd dimension because the batch_first attribute + Note that for the field ("s", "v"), the batch is in the 2nd dimension because the batch_first attribute is False. capacity (int): The maximum stored experience in the store. @@ -86,22 +86,22 @@ def put(self, exp_dict: dict): Args: exp_dict (dict): The dictionary of a batch of experience. For example: - + { - 's': + "s": { - 'p': numpy.array with size (batch, 32, 64), - 'v': numpy.array with size (32, batch, 48), + "p": numpy.array with size (batch, 32, 64), + "v": numpy.array with size (32, batch, 48), } } The structure should be consistent with the structure defined in the __init__ function. - + Returns: indexes (numpy.array): The list of the indexes each experience in the batch is located in. """ - dlen = exp_dict['len'] + dlen = exp_dict["len"] append_end = min(max(self.capacity - self.cnt, 0), dlen) idxs = np.zeros(dlen, dtype=np.int) if append_end != 0: @@ -130,9 +130,9 @@ def _get_replace_idx(self, cnt): def get(self, indexes:np.array): """Get the experience indexed in the indexes list from the store - Args: + Args: indexes (np.array): A numpy array containing the indexes of a batch experience. - + Returns: data_dict (dict): the structure same as that defined in the __init__ function. """ @@ -162,7 +162,7 @@ def clear(self): class Shuffler: def __init__(self, store: NumpyStore, batch_size: int): """The helper class for fast batch sampling. - + Args: store (NumpyStore): The data source for sampling. batch_size (int): The size of a batch. @@ -186,4 +186,4 @@ def next(self): def has_next(self): """Check if any experience is not visited. """ - return self._start < len(self._store) \ No newline at end of file + return self._start < len(self._store) diff --git a/examples/cim/gnn/shared_structure.py b/examples/cim/gnn/shared_structure.py index 32713f336..f0bc150b2 100644 --- a/examples/cim/gnn/shared_structure.py +++ b/examples/cim/gnn/shared_structure.py @@ -4,9 +4,9 @@ def init_shared_memory(data_structure): # data_structure should be a dict like: # { - # 'a': (shape, type), - # 'b': { - # 'b1': (shape, type), + # "a": (shape, type), + # "b": { + # "b1": (shape, type), # } # } if isinstance(data_structure, tuple): @@ -35,4 +35,4 @@ def __init__(self, data_structure): self.shared = init_shared_memory(data_structure) def structuralize(self): - return shared_data2numpy(self.shared, self.data_structure) \ No newline at end of file + return shared_data2numpy(self.shared, self.data_structure) diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 5f736b2a4..28dc961a7 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -13,8 +13,8 @@ class PositionalEncoder(nn.Module): """ The positional encoding used in transformer to get the sequential information. - - The code is based on the PyTorch version in web + + The code is based on the PyTorch version in web https://pytorch.org/tutorials/beginner/transformer_tutorial.html?highlight=positionalencoding """ @@ -22,17 +22,17 @@ def __init__(self, d_model, max_seq_len = 80): super().__init__() self.d_model = d_model self.times = 4*math.sqrt(self.d_model) - - # create constant 'pe' matrix with values dependant on + + # create constant "pe" matrix with values dependant on # pos and i self.pe = torch.zeros(max_seq_len, d_model) for pos in range(max_seq_len): for i in range(0, d_model, 2): self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i)/d_model))) self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1))/d_model))) - + self.pe = self.pe.unsqueeze(1)/self.d_model - + def forward(self, x): # make embeddings relatively larger # x = x * self.sqrt_d_model @@ -43,10 +43,10 @@ def forward(self, x): class SimpleGATLayer(nn.Module): """The enhanced graph attention layer for heterogenenous neighborhood. - It first utilizes pre-layers for both the source and destination node to map their features into the same hidden - size. If the edge also has features, they are concatenated with those of the corresponding source node before being - fed to the pre-layers. Then the graph attention(https://arxiv.org/abs/1710.10903) is done to aggregate information - from the source nodes to the destination nodes. The residual connection and layer normalization are also used to + It first utilizes pre-layers for both the source and destination node to map their features into the same hidden + size. If the edge also has features, they are concatenated with those of the corresponding source node before being + fed to the pre-layers. Then the graph attention(https://arxiv.org/abs/1710.10903) is done to aggregate information + from the source nodes to the destination nodes. The residual connection and layer normalization are also used to enhance the performance, which is similar to the Transformer(https://arxiv.org/abs/1706.03762). Args: @@ -87,10 +87,10 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor Args: src (Tensor): The source nodes in a batch of graph. dest (Tensor): The destination nodes in a batch of graph. - adj (Tensor): The adjencency list stored in a 2D matrix in the batch-second format. The first dimension is - the maximum amount of the neighbors the destinations have. As the neighbor quantities vary from one + adj (Tensor): The adjencency list stored in a 2D matrix in the batch-second format. The first dimension is + the maximum amount of the neighbors the destinations have. As the neighbor quantities vary from one destination to another, the short sequences are padded with 0. - mask (Tensor): The mask identifies if a position in the adj is padded. Note that it is stored in the + mask (Tensor): The mask identifies if a position in the adj is padded. Note that it is stored in the batch-first format. Returns: @@ -103,14 +103,14 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor mask: (batch*dest_cnt)*src_neighbor_cnt edges: (batch*dest_cnt, src_neighbor_cnt, edge_dim) destination_emb: (batch, dest_cnt, hidden_size) - + """ assert(self.src_dim == src.shape[-1]) assert(self.dest_dim== dest.shape[-1]) batch, s_cnt, src_dim = src.shape batch, d_cnt, dest_dim = dest.shape src_neighbor_cnt = adj.shape[0] - + src_embedding = src.reshape(-1, src_dim) src_embedding = torch.cat((self.zero_padding_template.to(src_embedding.get_device()), src_embedding)) @@ -124,7 +124,7 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor src_input = self.src_pre_layer(src_embedding.reshape(-1, src_dim+self.edge_dim)).reshape(*src_embedding.shape[:2], self.hidden_size) dest_input = self.dest_pre_layer(dest.reshape(-1, dest_dim)).reshape(1, batch*d_cnt, self.hidden_size) dest_emb, _ = self.att(dest_input, src_input, src_input, key_padding_mask=mask) - + dest_emb = dest_emb + self.att_dropout(dest_emb) dest_emb = self.att_norm(dest_emb) return dest_emb.reshape(batch, d_cnt, self.hidden_size) @@ -133,8 +133,8 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor class SimpleTransformer(nn.Module): """Graph attention network with multiple graph in the CIM scenario. - - This module aggregates information in the port-to-port graph, port-to-vessel graph and vessel-to-port graph. The + + This module aggregates information in the port-to-port graph, port-to-vessel graph and vessel-to-port graph. The aggregation in the two graph are done separatedly and then the port features are concatenated as the final result. Args: @@ -149,14 +149,14 @@ def __init__(self, p_dim, v_dim, edge_dim:dict, output_size, layer_num=2): super().__init__() self.hidden_size = output_size self.layer_num = layer_num - + pl, vl, ppl = [], [], [] for i in range(layer_num): if i==0: - pl.append(SimpleGATLayer(v_dim, p_dim, edge_dim['v'], self.hidden_size, nhead=4)) - vl.append(SimpleGATLayer(p_dim, v_dim, edge_dim['v'], self.hidden_size, nhead=4)) + pl.append(SimpleGATLayer(v_dim, p_dim, edge_dim["v"], self.hidden_size, nhead=4)) + vl.append(SimpleGATLayer(p_dim, v_dim, edge_dim["v"], self.hidden_size, nhead=4)) # p2p links - ppl.append(SimpleGATLayer(p_dim, p_dim, edge_dim['p'], self.hidden_size, nhead=4, position_encoding=False)) + ppl.append(SimpleGATLayer(p_dim, p_dim, edge_dim["p"], self.hidden_size, nhead=4, position_encoding=False)) else: pl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) if i != layer_num - 1: @@ -169,7 +169,7 @@ def __init__(self, p_dim, v_dim, edge_dim:dict, output_size, layer_num=2): def forward(self, p, pe, v, ve, ppe): """Do the multi-channel graph attention. - + Args: p (Tensor): The port feature. pe (Tensor): The vessel-port edge feature. @@ -182,10 +182,10 @@ def forward(self, p, pe, v, ve, ppe): pre_p, pre_v, pre_pp = p, v, pp for i in range(self.layer_num): # only feed edge info in the first layer - p = self.p_layers[i](pre_v, pre_p, adj=pe['adj'], edges=pe['edge'] if i==0 else None, mask=pe['mask']) + p = self.p_layers[i](pre_v, pre_p, adj=pe["adj"], edges=pe["edge"] if i==0 else None, mask=pe["mask"]) if i != self.layer_num - 1: - v = self.v_layers[i](pre_p, pre_v, adj=ve['adj'], edges=ve['edge'] if i==0 else None, mask=ve['mask']) - pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe['adj'], edges=ppe['edge'] if i==0 else None, mask=ppe['mask']) + v = self.v_layers[i](pre_p, pre_v, adj=ve["adj"], edges=ve["edge"] if i==0 else None, mask=ve["mask"]) + pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe["adj"], edges=ppe["edge"] if i==0 else None, mask=ppe["mask"]) pre_p, pre_v, pre_pp = p, v, pp p = torch.cat((p, pp), axis=2) return p, v @@ -195,41 +195,41 @@ class GeLU(nn.Module): """ def __init__(self): super().__init__() - + def forward(self, input): return F.gelu(input) class Header(nn.Module): - def __init__(self, input_size, hidden_size, output_size, net_type='res'): + def __init__(self, input_size, hidden_size, output_size, net_type="res"): super().__init__() self.net_type = net_type - if net_type == 'res': + if net_type == "res": self.fc_0 = nn.Linear(input_size, hidden_size) self.act_0 = GeLU() # self.do_0 = Dropout(dropout) self.fc_1 = nn.Linear(hidden_size, input_size) self.act_1 = GeLU() self.fc_2 = nn.Linear(input_size, output_size) - elif net_type == '2layer': + elif net_type == "2layer": self.fc_0 = nn.Linear(input_size, hidden_size) self.act_0 = GeLU() # self.do_0 = Dropout(dropout) self.fc_1 = nn.Linear(hidden_size, hidden_size//2) self.act_1 = GeLU() self.fc_2 = nn.Linear(hidden_size//2, output_size) - elif net_type == '1layer': + elif net_type == "1layer": self.fc_0 = nn.Linear(input_size, hidden_size) self.act_0 = GeLU() self.fc_1 = nn.Linear(hidden_size, output_size) - + def forward(self, x): - if self.net_type == 'res': + if self.net_type == "res": x1 = self.act_0(self.fc_0(x)) x1 = self.act_1(self.fc_1(x1) + x) return self.fc_2(x1) - elif self.net_type == '2layer': + elif self.net_type == "2layer": x = self.act_0(self.fc_0(x)) x = self.act_1(self.fc_1(x)) x = self.fc_1(x) @@ -242,13 +242,13 @@ def forward(self, x): class SharedAC(nn.Module): """The actor-critic module shared with multiple agents. - This module maps the input graph of the observation to the policy and value space. It first extracts the temporal + This module maps the input graph of the observation to the policy and value space. It first extracts the temporal information separately for each node with a small transformer block and then extracts the spatial information with - a multi-graph/channel graph attention. Finally, the extracted feature embedding is fed to a actor header as well + a multi-graph/channel graph attention. Finally, the extracted feature embedding is fed to a actor header as well as a critic layer, which are the two MLPs with residual connections. """ - def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head='res'): + def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head="res"): super().__init__() assert(a or c) self.a, self.c = a, c @@ -259,19 +259,19 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer self.pre_dim_v, self.pre_dim_p = 8*scale, 16*scale self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) - p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation='gelu', dim_feedforward=self.pre_dim_p*4) - v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation='gelu', dim_feedforward=self.pre_dim_v*4) + p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation="gelu", dim_feedforward=self.pre_dim_p*4) + v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation="gelu", dim_feedforward=self.pre_dim_v*4) # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3) - + self.gnn_output_size = 32*scale self.trans_gat = SimpleTransformer( p_dim=self.pre_dim_p, v_dim=self.pre_dim_v, output_size=self.gnn_output_size//2, - edge_dim={'p': edge_dim_p, 'v': edge_dim_v}, + edge_dim={"p": edge_dim_p, "v": edge_dim_v}, layer_num=2 ) @@ -285,12 +285,12 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer self.value_hidden_size = 16*scale self.c_input = self.gnn_output_size self.critic = Header(self.c_input, self.value_hidden_size, 1, ac_head) - + def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): assert((a and p_idx is not None and v_idx is not None) or c) - feature_p, feature_v = state['p'], state['v'] - + feature_p, feature_v = state["p"], state["v"] + tb, bsize, p_cnt, _ = feature_p.shape v_cnt = feature_v.shape[2] assert(tb == self.tick_buffer) @@ -298,26 +298,26 @@ def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): # before: feature_p.shape: (tick_buffer, batch_size, p_cnt, p_dim) # after: feature_p.shape: (tick_buffer, batch_size*p_cnt, p_dim) feature_p = self.p_pre_layer(feature_p.reshape(feature_p.shape[0], -1, feature_p.shape[-1])) - # state['mask']: (batch_size, tick_buffer) + # state["mask"]: (batch_size, tick_buffer) # mask_p: (batch_size, p_cnt, tick_buffer) - mask_p = state['mask'].repeat(1, p_cnt).reshape(-1, self.tick_buffer) + mask_p = state["mask"].repeat(1, p_cnt).reshape(-1, self.tick_buffer) feature_p = self.trans_layer_p(feature_p, src_key_padding_mask=mask_p) feature_v = self.v_pre_layer(feature_v.reshape(feature_v.shape[0], -1, feature_v.shape[-1])) - mask_v = state['mask'].repeat(1, v_cnt).reshape(-1, self.tick_buffer) + mask_v = state["mask"].repeat(1, v_cnt).reshape(-1, self.tick_buffer) feature_v = self.trans_layer_v(feature_v, src_key_padding_mask=mask_v) feature_p = feature_p[0].reshape(bsize, p_cnt, self.pre_dim_p) feature_v = feature_v[0].reshape(bsize, v_cnt, self.pre_dim_v) - emb_p, emb_v = self.trans_gat(feature_p, state['pe'], feature_v, state['ve'], state['ppe']) - - # date_str = f"{datetime.datetime.now().strftime('%Y%m%d')}" - # time_str = f"{datetime.datetime.now().strftime('%H%M%S.%f')}" - # subfolder_name = '%s_%s'%('./visualization/graph_embedding_p.npy', time_str) - # np.save('%s_%s.npy'%('./visualization/emb/p_emb/emb', time_str), emb_p.cpu().detach().numpy()) - # np.save('%s_%s.npy'%('./visualization/emb/v_emb/emb', time_str), emb_v.cpu().detach().numpy()) - + emb_p, emb_v = self.trans_gat(feature_p, state["pe"], feature_v, state["ve"], state["ppe"]) + + # date_str = f"{datetime.datetime.now().strftime("%Y%m%d")}" + # time_str = f"{datetime.datetime.now().strftime("%H%M%S.%f")}" + # subfolder_name = "%s_%s"%("./visualization/graph_embedding_p.npy", time_str) + # np.save("%s_%s.npy"%("./visualization/emb/p_emb/emb", time_str), emb_p.cpu().detach().numpy()) + # np.save("%s_%s.npy"%("./visualization/emb/v_emb/emb", time_str), emb_v.cpu().detach().numpy()) + a_rtn, c_rtn = None, None if a and self.a: ap = emb_p.reshape(bsize, p_cnt, self.gnn_output_size) @@ -329,5 +329,4 @@ def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): if c and self.c: c_rtn = self.critic(emb_p).reshape(bsize, p_cnt) return a_rtn, c_rtn - - \ No newline at end of file + diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index ce5206214..f65bcdc05 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -12,11 +12,11 @@ class GNNStateShaper(StateShaper): feature_config (dict): The dottable dict that stores the configuration of the observation feature. max_value (int): The norm scale. All the feature are simply divided by this number. tick_buffer (int): The value n in n-step TD. - only_demo (bool): Define if the shaper instance is used only for shape demonstration(True) or runtime + only_demo (bool): Define if the shaper instance is used only for shape demonstration(True) or runtime shaping(False). """ - def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, + def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, tick_buffer=20, only_demo=False): # collect and encode all ports self.port_code_list = list(port_code_list) @@ -38,11 +38,11 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m self.vessel_one_hot_coding = np.expand_dims(one_hot_coding[self.port_cnt:], axis=0) self.last_tick = -1 - self.port_features = ['empty', 'full', 'capacity', - 'on_shipper', - 'on_consignee', 'booking', 'acc_booking', 'shortage', 'acc_shortage', - 'fulfillment', 'acc_fulfillment'] - self.vessel_features = ['empty', 'full', 'capacity', 'remaining_space'] + self.port_features = ["empty", "full", "capacity", + "on_shipper", + "on_consignee", "booking", "acc_booking", "shortage", "acc_shortage", + "fulfillment", "acc_fulfillment"] + self.vessel_features = ["empty", "full", "capacity", "remaining_space"] self._max_tick = max_tick self._tick_buffer = tick_buffer @@ -54,29 +54,29 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m self._only_demo = only_demo self._feature_config = feature_config - self._normalize = True + self._normalize = True self._norm_scale = 2.0/max_value if not only_demo: self._state_dict = { - # last 'tick' is used for embedding, all zero and never be modified. - 'v': np.zeros((self._max_tick+1, self.vessel_cnt, self.get_input_dim('v'))), - 'p': np.zeros((self._max_tick+1, self.port_cnt, self.get_input_dim('p'))), - 'vo': np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt), dtype=np.int), - 'po': np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt), dtype=np.int), - 'vedge': np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt, self.get_input_dim('vedge'))), - 'pedge': np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt, self.get_input_dim('vedge'))), - 'ppedge': np.zeros((self._max_tick+1, self.port_cnt, self.port_cnt, self.get_input_dim('pedge'))), + # last "tick" is used for embedding, all zero and never be modified. + "v": np.zeros((self._max_tick+1, self.vessel_cnt, self.get_input_dim("v"))), + "p": np.zeros((self._max_tick+1, self.port_cnt, self.get_input_dim("p"))), + "vo": np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt), dtype=np.int), + "po": np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt), dtype=np.int), + "vedge": np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt, self.get_input_dim("vedge"))), + "pedge": np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt, self.get_input_dim("vedge"))), + "ppedge": np.zeros((self._max_tick+1, self.port_cnt, self.port_cnt, self.get_input_dim("pedge"))), } # fixed order: in the order of degree - + def compute_static_graph_structure(self, env): v2p_adj_matrix = compute_v2p_degree_matrix(env) p2p_adj_matrix = np.dot(v2p_adj_matrix.T, v2p_adj_matrix) p2p_adj_matrix[p2p_adj_matrix==0] = self.max_arrival_time np.fill_diagonal(p2p_adj_matrix, self.max_arrival_time) self._p2p_embedding = self.sort(p2p_adj_matrix) - + v2p_adj_matrix = -v2p_adj_matrix v2p_adj_matrix[v2p_adj_matrix == 0] = self.max_arrival_time self._fixed_v_order = self.sort(v2p_adj_matrix) @@ -91,7 +91,7 @@ def sort(self, arrival_time, attr=None): given the arrival time matrix, this function sort the matrix and return the index matrix in the order of arrival time """ n, m = arrival_time.shape - if self._feature_config.attention_order == 'ramdom': + if self._feature_config.attention_order == "ramdom": arrival_time = arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape) at_index = np.argsort(arrival_time, axis=1) if attr is not None: @@ -107,9 +107,9 @@ def sort(self, arrival_time, attr=None): """ def arg_idx(self, arrival_time, p_or_v): - if self._feature_config.attention_order == 'temporal': + if self._feature_config.attention_order == "temporal": return self.sort(arrival_time) - elif self._feature_config.attention_order == 'meta_path_cnt': + elif self._feature_config.attention_order == "meta_path_cnt": return self._fixed_p_order if p_or_v else self._fixed_v_order else: # randomize the arrival time @@ -121,10 +121,10 @@ def end_ep_callback(self, snapshot_list): return tick_range = np.arange(start=self.last_tick, stop=self._max_tick) self._sync_raw_features(snapshot_list, list(tick_range)) - + port_features = snapshot_list["ports"][list(range(self._max_tick)):self.port_code_list: self.port_features] \ .reshape(self._max_tick, self.port_cnt, -1) - # pkl.dump(port_features, open('/data/log/replay/snapshot.pkl', 'wb')) + # pkl.dump(port_features, open("/data/log/replay/snapshot.pkl", "wb")) self.last_tick = -1 def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): @@ -143,7 +143,7 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami # normalize features to a small range # port_state_mat = self.normalize(np.concatenate([port_naive_feature, full_on_port], axis=2)) port_state_mat = self.normalize(port_naive_feature) - + if self._feature_config.onehot_identity: # add onehot vector to identify port and vessel port_onehot = np.repeat(self.port_one_hot_coding, len(tick_range), axis=0) @@ -152,17 +152,17 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami # print(dynamic_code, self.node_code_inv_dict_v[dynamic_code]) port_onehot[-1, self.port_code_inv_dict[static_code], self.node_code_inv_dict_v[dynamic_code]] = -1 port_state_mat = np.concatenate([port_state_mat, port_onehot], axis=2) - self._state_dict['p'][tick_range] = port_state_mat + self._state_dict["p"][tick_range] = port_state_mat vessel_naive_feature = snapshot_list["vessels"][tick_range:self.vessel_code_list: self.vessel_features] \ .reshape(len(tick_range), self.vessel_cnt, -1) full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape(len(tick_range), self.vessel_cnt, self.port_cnt) - # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) + # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) vessel_state_mat = self.normalize(vessel_naive_feature) if self._feature_config.onehot_identity: vessel_state_mat = np.concatenate([vessel_state_mat, np.repeat(self.vessel_one_hot_coding, len(tick_range), axis=0)], axis=2) - self._state_dict['v'][tick_range] = vessel_state_mat + self._state_dict["v"][tick_range] = vessel_state_mat # last_arrival_time.shape: vessel_cnt * port_cnt # -1 means one vessel never stops at the port @@ -178,21 +178,21 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami vedge_raw = self.normalize(np.stack((full_on_vessel[-1], last_arrival_time), axis=-1)) vo, vedge = self.sort(last_arrival_time, attr=vedge_raw) po, pedge = self.sort(last_arrival_time.T, attr=vedge_raw.transpose((1,0,2))) - self._state_dict['vo'][tick_range] = np.expand_dims(vo, axis=0) - self._state_dict['vedge'][tick_range] = np.expand_dims(vedge, axis=0) - self._state_dict['po'][tick_range] = np.expand_dims(po, axis=0) - self._state_dict['pedge'][tick_range] = np.expand_dims(pedge, axis=0) - self._state_dict['ppedge'][tick_range] = self.normalize(full_on_port[-1]).reshape(1, *full_on_port[-1].shape, 1) + self._state_dict["vo"][tick_range] = np.expand_dims(vo, axis=0) + self._state_dict["vedge"][tick_range] = np.expand_dims(vedge, axis=0) + self._state_dict["po"][tick_range] = np.expand_dims(po, axis=0) + self._state_dict["pedge"][tick_range] = np.expand_dims(pedge, axis=0) + self._state_dict["ppedge"][tick_range] = self.normalize(full_on_port[-1]).reshape(1, *full_on_port[-1].shape, 1) def __call__(self, action_info=None, snapshot_list=None, tick=None): if self._only_demo: return assert((action_info is not None and snapshot_list is not None) or tick is not None) - + if action_info is not None and snapshot_list is not None: # update the state dict - static_code = action_info.port_idx + static_code = action_info.port_idx dynamic_code = action_info.vessel_idx if self.last_tick == action_info.tick: tick_range = [action_info.tick] @@ -207,27 +207,27 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): # state_tick_range is inverse order state_tick_range = np.arange(tick, max(-1, tick-self._tick_buffer), -1) # print(state_tick_range) - v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim('v'))) - v[:len(state_tick_range)] = self._state_dict['v'][state_tick_range] - p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim('p'))) - p[:len(state_tick_range)] = self._state_dict['p'][state_tick_range] + v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim("v"))) + v[:len(state_tick_range)] = self._state_dict["v"][state_tick_range] + p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim("p"))) + p[:len(state_tick_range)] = self._state_dict["p"][state_tick_range] # true means padding mask = np.ones(self._tick_buffer, dtype=np.bool) mask[:len(state_tick_range)] = False ret = { - 'tick': state_tick_range, - 'v': v, - 'p': p, - 'vo': self._state_dict['vo'][tick], - 'po': self._state_dict['po'][tick], - 'vedge': self._state_dict['vedge'][tick], - 'pedge': self._state_dict['pedge'][tick], - 'ppedge': self._state_dict['ppedge'][tick], - 'mask': mask, - 'len': len(state_tick_range), + "tick": state_tick_range, + "v": v, + "p": p, + "vo": self._state_dict["vo"][tick], + "po": self._state_dict["po"][tick], + "vedge": self._state_dict["vedge"][tick], + "pedge": self._state_dict["pedge"][tick], + "ppedge": self._state_dict["ppedge"][tick], + "mask": mask, + "len": len(state_tick_range), } - + return ret def normalize(self, feature): @@ -236,15 +236,15 @@ def normalize(self, feature): return feature*self._norm_scale def get_input_dim(self, agent_code): - if agent_code in self.port_code_inv_dict or agent_code == 'p': + if agent_code in self.port_code_inv_dict or agent_code == "p": return len(self.port_features) + (self.node_cnt if self._feature_config.onehot_identity else 0) - elif agent_code in self.vessel_code_inv_dict or agent_code == 'v': + elif agent_code in self.vessel_code_inv_dict or agent_code == "v": return len(self.vessel_features) + (self.node_cnt if self._feature_config.onehot_identity else 0) - elif agent_code == 'vedge': + elif agent_code == "vedge": # v-p edge: (arrival_time, laden to destination) return 2 - elif agent_code == 'pedge': + elif agent_code == "pedge": # p-p edge: (laden to destination, ) return 1 else: - raise ValueError('agent not exist!') + raise ValueError("agent not exist!") diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 92443585d..51169d0c2 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -13,19 +13,19 @@ from maro.utils import convert_dottable, clone def compute_v2p_degree_matrix(env): - """This function compute the adjacent matrix + """This function compute the adjacent matrix """ topo_config = env.configs - static_dict = env.summary['node_mapping']['ports'] - dynamic_dict = env.summary['node_mapping']['vessels'] + static_dict = env.summary["node_mapping"]["ports"] + dynamic_dict = env.summary["node_mapping"]["vessels"] adj_matrix = np.zeros((len(dynamic_dict), len(static_dict)), dtype=np.int) - for v, vinfo in topo_config['vessels'].items(): - route_name = vinfo['route']['route_name'] - route = topo_config['routes'][route_name] + for v, vinfo in topo_config["vessels"].items(): + route_name = vinfo["route"]["route_name"] + route = topo_config["routes"][route_name] vid = dynamic_dict[v] for p in route: - adj_matrix[vid][static_dict[p['port_name']]] += 1 - + adj_matrix[vid][static_dict[p["port_name"]]] += 1 + return adj_matrix def warm_up_lr(opt, warmup_steps): @@ -49,7 +49,7 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): seq_len, batch, v_cnt, v_dim = v.shape _, _, p_cnt, p_dim = p.shape - p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask = from_numpy(device, p, po, pedge, + p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask = from_numpy(device, p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask) batch_range = torch.arange(batch, dtype=torch.long).to(device) @@ -68,7 +68,7 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): padj = padj.transpose(0, 1) pedge = pedge.transpose(0, 1) # pedge = pedge.reshape(-1, *pedge.shape[-2:]).transpose(0, 1)[:padj.shape[0]] - + p2p_adj = p2p.repeat(batch, 1, 1) # p2p_adj.shape: (batch*p_cnt, p_cnt*) p2p_adj, ppedge = flatten_embedding(p2p_adj, batch_range, ppedge) @@ -79,24 +79,24 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): ppedge = ppedge.transpose(0, 1) return { - 'v': v, - 'p': p, - 'pe': { - 'edge': pedge, - 'adj': padj, - 'mask': pmask, + "v": v, + "p": p, + "pe": { + "edge": pedge, + "adj": padj, + "mask": pmask, }, - 've': { - 'edge': vedge, - 'adj': vadj, - 'mask': vmask, + "ve": { + "edge": vedge, + "adj": vadj, + "mask": vmask, }, - 'ppe': { - 'edge': ppedge, - 'adj': p2p_adj, - 'mask': p2p_mask, + "ppe": { + "edge": ppedge, + "adj": p2p_adj, + "mask": p2p_mask, }, - 'mask': seq_mask, + "mask": seq_mask, } @@ -124,14 +124,14 @@ def log2json(file_path): """load the log file as a json list. """ - with open(file_path, 'r') as fp: + with open(file_path, "r") as fp: lines = fp.read().splitlines() - json_list = '[' + ','.join(lines) + ']' + json_list = "[" + ",".join(lines) + "]" return ast.literal_eval(json_list) def decision_cnt_analysis(env, pv=False, buffer_size=8): if not pv: - decision_cnt = [buffer_size] * len(env.node_name_mapping['static']) + decision_cnt = [buffer_size] * len(env.node_name_mapping["static"]) r, pa, is_done = env.step(None) while not is_done: decision_cnt[pa.port_idx] += 1 @@ -153,7 +153,7 @@ def decision_cnt_analysis(env, pv=False, buffer_size=8): def random_shortage(env, tick, action_dim=21): zero_idx = action_dim//2 r, pa, is_done = env.step(None) - node_cnt = len(env.summary['node_mapping']['ports']) + node_cnt = len(env.summary["node_mapping"]["ports"]) while not is_done: """ load, discharge = pa.action_scope.load, pa.action_scope.discharge @@ -166,9 +166,9 @@ def random_shortage(env, tick, action_dim=21): # print(action_idx, -load, actual_action, discharge) action = Action(pa.vessel_idx, pa.port_idx, 0) r, pa, is_done = env.step(action) - - shs = env.snapshot_list['ports'][tick-1:list(range(node_cnt)):'acc_shortage'] - fus = env.snapshot_list['ports'][tick-1:list(range(node_cnt)):'acc_fulfillment'] + + shs = env.snapshot_list["ports"][tick-1:list(range(node_cnt)):"acc_shortage"] + fus = env.snapshot_list["ports"][tick-1:list(range(node_cnt)):"acc_fulfillment"] env.reset() return fus - shs, np.sum(shs+fus) @@ -176,13 +176,13 @@ def return_scaler(env, tick, gamma, action_dim=21): R, tot_amount = random_shortage(env, tick, action_dim) Rs_mean = np.mean(R)/tick/(1-gamma) return abs(1.0/Rs_mean), tot_amount - + def load_config(config_pth): - with io.open(config_pth, 'r') as in_file: + with io.open(config_pth, "r") as in_file: raw_config = yaml.safe_load(in_file) config = convert_dottable(raw_config) - + if config.env.seed < 0: config.env.seed = random.randint(0, 99999) @@ -190,11 +190,11 @@ def load_config(config_pth): return config def save_config(config, config_pth): - with open(config_pth, 'w') as fp: + with open(config_pth, "w") as fp: config = dottable2dict(config) - config['env']['exp_per_ep'] = ['%d, %d, %d'%(k[0], k[1],d) for k, d in config['env']['exp_per_ep'].items()] + config["env"]["exp_per_ep"] = ["%d, %d, %d"%(k[0], k[1],d) for k, d in config["env"]["exp_per_ep"].items()] yaml.safe_dump(config, fp) - + def dottable2dict(config): if isinstance(config, float): return str(config) @@ -206,19 +206,19 @@ def dottable2dict(config): return rt def save_code(folder, save_pth): - save_path = os.path.join(save_pth,'code') + save_path = os.path.join(save_pth,"code") code_pth = os.path.join(os.getcwd(),folder) shutil.copytree(code_pth,save_path) def fix_seed(env, seed): env.set_seed(seed) - np.random.seed(seed) + np.random.seed(seed) random.seed(seed) def zero_play(**args): env = Env(**args) - static_mapping = env.node_name_mapping['static'] + static_mapping = env.node_name_mapping["static"] r, pa, is_done = env.step(None) while not is_done: action = Action(pa.vessel_idx, pa.port_idx, 0) @@ -234,31 +234,31 @@ def parse_value(v): try: return float(v) except: - if v == 'false' or v == 'False': + if v == "false" or v == "False": return False - elif v == 'true' or v == 'True': + elif v == "true" or v == "True": return True else: return v def set_attr(config, attrs, value): if len(attrs) == 1: - config[attrs[0]] = value + config[attrs[0]] = value else: set_attr(config[attrs[0]], attrs[1:], value) all_args = sys.argv[1:] for i in range(len(all_args)//2): name = all_args[i*2] - attrs = name[2:].split('.') + attrs = name[2:].split(".") value = parse_value(all_args[i*2+1]) - set_attr(config, attrs, value) + set_attr(config, attrs, value) def analysis_speed(env): speed_dict = defaultdict(int) eq_speed = 0 - for ves in env.configs['vessels'].values(): - speed_dict[ves['sailing']['speed']] += 1 + for ves in env.configs["vessels"].values(): + speed_dict[ves["sailing"]["speed"]] += 1 for sp, cnt in speed_dict.items(): eq_speed += 1.0*cnt/sp eq_speed = 1.0/eq_speed From 2f3f0717d7e4afb1df975c8a7b7479f36e04e4cc Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Thu, 15 Oct 2020 16:15:23 +0800 Subject: [PATCH 11/25] fix code bugs due to refactoring mistake --- examples/cim/gnn/launcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 143198d7f..2f0d3ca47 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -16,8 +16,8 @@ config = load_config(config_pth) # generate log path. - date_str = f"{datetime.datetime.now().strftime("%Y%m%d")}" - time_str = f"{datetime.datetime.now().strftime("%H%M%S.%f")}" + date_str = datetime.datetime.now().strftime("%Y%m%d") + time_str = datetime.datetime.now().strftime("%H%M%S.%f") subfolder_name = "%s_%s"%(config.env.param.topology, time_str) # log path. From 522eeb5d05998fa1b2ec935da8644fb4c240734d Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Thu, 15 Oct 2020 16:56:07 +0800 Subject: [PATCH 12/25] refine the code format --- examples/cim/gnn/action_shaper.py | 3 +- examples/cim/gnn/actor.py | 41 +++++++++++++-------------- examples/cim/gnn/actor_critic.py | 3 +- examples/cim/gnn/agent.py | 8 ++++-- examples/cim/gnn/agent_manager.py | 10 ++++--- examples/cim/gnn/experience_shaper.py | 3 +- examples/cim/gnn/launcher.py | 8 ++++-- examples/cim/gnn/learner.py | 5 ++-- examples/cim/gnn/numpy_store.py | 6 ++-- examples/cim/gnn/shared_structure.py | 1 + examples/cim/gnn/simple_gnn.py | 13 ++++----- examples/cim/gnn/state_shaper.py | 34 +++++++++++----------- examples/cim/gnn/utils.py | 8 ++---- 13 files changed, 71 insertions(+), 72 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index a91121fd9..90451c019 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -1,8 +1,7 @@ from maro.rl import ActionShaper class DiscreteActionShaper(ActionShaper): - """The shaping class to transform the action in [-1, 1] to actual repositioning function. - """ + """The shaping class to transform the action in [-1, 1] to actual repositioning function. """ def __init__(self, action_dim): super().__init__() self._action_dim = action_dim diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index f23b0078e..44375d026 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -1,24 +1,23 @@ import ctypes import multiprocessing -import numpy as np import time, os, pickle from collections import defaultdict, OrderedDict from multiprocessing import Process, Pipe, Event, Manager +import numpy as np import torch -from maro.rl import AbsActor -from maro.simulator import Env -from maro.simulator.scenarios.cim.common import Action, DecisionEvent -from maro.utils import Logger, LogFormat, convert_dottable - from examples.cim.gnn.actor_critic import ActorCritic from examples.cim.gnn.action_shaper import DiscreteActionShaper +from examples.cim.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix from examples.cim.gnn.utils import fix_seed, gnn_union from examples.cim.gnn.experience_shaper import ExperienceShaper from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.shared_structure import SharedStructure -from examples.cim.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix +from maro.rl import AbsActor +from maro.simulator import Env +from maro.simulator.scenarios.cim.common import Action, DecisionEvent +from maro.utils import Logger, LogFormat, convert_dottable def organize_exp_list(experience_collections:dict, idx_mapping:dict): @@ -73,8 +72,7 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): return result def organize_obs(obs, idx, exp_len): - """Helper function to transform the observation from multiple processes to a unified dictionary. - """ + """Helper function to transform the observation from multiple processes to a unified dictionary. """ tick_buffer, _, para_cnt, v_cnt, v_dim = obs["v"].shape _, _, _, p_cnt, p_dim = obs["p"].shape batch = exp_len * para_cnt @@ -138,12 +136,12 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou i = 0 while pipe.recv() == "reset": env.reset() - r, pa, is_done = env.step(None) - j = 0 + r, decision_event, is_done = env.step(None) + j = 0 logs = [] while not is_done: - model_input = gnn_state_shaper(pa, env.snapshot_list) + model_input = gnn_state_shaper(decision_event, env.snapshot_list) action_io_np["v"][:, index] = model_input["v"] action_io_np["p"][:, index] = model_input["p"] action_io_np["vo"][index] = model_input["vo"] @@ -152,16 +150,16 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou action_io_np["pedge"][index] = model_input["pedge"] action_io_np["ppedge"][index] = model_input["ppedge"] action_io_np["mask"][index] = model_input["mask"] - action_io_np["pid"][index] = pa.port_idx - action_io_np["vid"][index] = pa.vessel_idx + action_io_np["pid"][index] = decision_event.port_idx + action_io_np["vid"][index] = decision_event.vessel_idx pipe.send("features") model_action = pipe.recv() - env_action = action_shaper(pa, model_action) - exp_shaper.record(pending_action=pa, model_action=model_action, model_input=model_input) - logs.append([index, pa.tick, pa.port_idx, pa.vessel_idx, model_action, env_action, pa.action_scope.load, - pa.action_scope.discharge]) - action = Action(pa.vessel_idx, pa.port_idx, env_action) - r, pa, is_done = env.step(action) + env_action = action_shaper(decision_event, model_action) + exp_shaper.record(pending_action=decision_event, model_action=model_action, model_input=model_input) + logs.append([index, decision_event.tick, decision_event.port_idx, decision_event.vessel_idx, model_action, env_action, decision_event.action_scope.load, + decision_event.action_scope.discharge]) + action = Action(decision_event.vessel_idx, decision_event.port_idx, env_action) + r, decision_event, is_done = env.step(action) j += 1 action_io_np["sh"][index] = compute_shortage(env.snapshot_list, config.env.param.durations, static_code_list) # print("one ep done!") @@ -363,8 +361,7 @@ def roll_out(self): return result def exit(self): - """Terminate the child processes. - """ + """Terminate the child processes. """ for p in self.pipes: p[0].send("close") diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index b0f65a1ca..f68c4c480 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -5,9 +5,8 @@ from torch.distributions import Categorical from torch.nn.utils import clip_grad -from maro.rl import AbsAlgorithm - from examples.cim.gnn.utils import gnn_union +from maro.rl import AbsAlgorithm class ActorCritic(AbsAlgorithm): """Actor-Critic algorithm in CIM problem. diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index 68ab0f80d..dfc75abc7 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -1,10 +1,12 @@ -from maro.rl import AbsAgent -from maro.utils import DummyLogger import time from collections import defaultdict -from examples.cim.gnn.numpy_store import Shuffler + import numpy as np +from examples.cim.gnn.numpy_store import Shuffler +from maro.rl import AbsAgent +from maro.utils import DummyLogger + class TrainableAgent(AbsAgent): def __init__(self, name, algorithm, experience_pool, logger=DummyLogger()): self._logger = logger diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index a61cef20c..9719f3eb7 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -1,14 +1,16 @@ -from maro.rl import AbsAgentManager, AgentMode +from copy import copy + +import numpy as np +import torch + from examples.cim.gnn.agent import TrainableAgent from examples.cim.gnn.actor_critic import ActorCritic from examples.cim.gnn.simple_gnn import SharedAC from examples.cim.gnn.numpy_store import NumpyStore from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.utils import compute_v2p_degree_matrix +from maro.rl import AbsAgentManager, AgentMode from maro.utils import DummyLogger -import numpy as np -from copy import copy -import torch class SimpleAgentManger(AbsAgentManager): def __init__(self, name, diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index cdb5426f7..7ee757866 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -1,6 +1,7 @@ -import numpy as np from collections import defaultdict +import numpy as np + class ExperienceShaper: def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, discount_factor=0.97, idx=-1, shared_storage=None, exp_idx_mapping=None): diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 2f0d3ca47..9c5561efd 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -1,14 +1,13 @@ import os import datetime -from maro.simulator import Env -from maro.utils import Logger - from examples.cim.gnn.actor import ParallelActor from examples.cim.gnn.learner import GNNLearner from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.utils import decision_cnt_analysis, load_config, save_config, save_code, return_scaler from examples.cim.gnn.agent_manager import SimpleAgentManger +from maro.simulator import Env +from maro.utils import Logger if __name__ == "__main__": @@ -58,8 +57,11 @@ gnn_state_shaper, training_logger) agent_manager.assemble(config) + """ + # currently not support loading model if os.path.exists(config.model.path): agent_manager.load_models_from(config.model.path) + """ # create the rollout actor to collect experience. actor = ParallelActor(config, demo_env, gnn_state_shaper, agent_manager, logger=simulation_logger) diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index dbf04ca2a..7837d699b 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -1,11 +1,10 @@ import time import os -from maro.rl import AbsLearner -from maro.utils import DummyLogger - from examples.cim.gnn.agent_manager import SimpleAgentManger from examples.cim.gnn.actor import ParallelActor +from maro.rl import AbsLearner +from maro.utils import DummyLogger class GNNLearner(AbsLearner): """Learner class for the training pipeline and the specialized logging in GNN solution for CIM problem. diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index 4ce30a8ff..300a7591f 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -174,8 +174,7 @@ def __init__(self, store: NumpyStore, batch_size: int): self._batch_size = batch_size def next(self): - """Uniformly sampling out a batch in the store. - """ + """Uniformly sampling out a batch in the store. """ if self._start >= len(self._store): return None end = min(self._start + self._batch_size, len(self._store)) @@ -184,6 +183,5 @@ def next(self): return rst def has_next(self): - """Check if any experience is not visited. - """ + """Check if any experience is not visited. """ return self._start < len(self._store) diff --git a/examples/cim/gnn/shared_structure.py b/examples/cim/gnn/shared_structure.py index f0bc150b2..d7049dfe8 100644 --- a/examples/cim/gnn/shared_structure.py +++ b/examples/cim/gnn/shared_structure.py @@ -1,4 +1,5 @@ import multiprocessing + import numpy as np def init_shared_memory(data_structure): diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 28dc961a7..f9b8c939a 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -4,7 +4,6 @@ import torch.nn as nn from torch import Tensor from torch.nn import functional as F -# lib for transformer from torch.nn import TransformerEncoder, TransformerEncoderLayer from torch.nn.modules.activation import MultiheadAttention from torch.nn.modules.dropout import Dropout @@ -28,8 +27,8 @@ def __init__(self, d_model, max_seq_len = 80): self.pe = torch.zeros(max_seq_len, d_model) for pos in range(max_seq_len): for i in range(0, d_model, 2): - self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i)/d_model))) - self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1))/d_model))) + self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i) / d_model))) + self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1)) / d_model))) self.pe = self.pe.unsqueeze(1)/self.d_model @@ -66,7 +65,7 @@ def __init__(self, src_dim, dest_dim, edge_dim, hidden_size, nhead=4, position_e self.hidden_size = hidden_size self.nhead = nhead src_layers = [] - src_layers.append(nn.Linear(src_dim+edge_dim, hidden_size)) + src_layers.append(nn.Linear(src_dim + edge_dim, hidden_size)) src_layers.append(GeLU()) self.src_pre_layer = nn.Sequential(*src_layers) @@ -185,14 +184,14 @@ def forward(self, p, pe, v, ve, ppe): p = self.p_layers[i](pre_v, pre_p, adj=pe["adj"], edges=pe["edge"] if i==0 else None, mask=pe["mask"]) if i != self.layer_num - 1: v = self.v_layers[i](pre_p, pre_v, adj=ve["adj"], edges=ve["edge"] if i==0 else None, mask=ve["mask"]) - pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe["adj"], edges=ppe["edge"] if i==0 else None, mask=ppe["mask"]) + pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe["adj"], + edges=ppe["edge"] if i==0 else None, mask=ppe["mask"]) pre_p, pre_v, pre_pp = p, v, pp p = torch.cat((p, pp), axis=2) return p, v class GeLU(nn.Module): - """Simple gelu wrapper as a independent module. - """ + """Simple gelu wrapper as a independent module. """ def __init__(self): super().__init__() diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index f65bcdc05..7c83f1ada 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -1,6 +1,7 @@ import numpy as np + from maro.rl.shaping.state_shaper import StateShaper -from .utils import compute_v2p_degree_matrix +from examples.cim.gnn.utils import compute_v2p_degree_matrix class GNNStateShaper(StateShaper): """State shaper to extract graph information. @@ -88,7 +89,8 @@ def p2p_static_graph(self): def sort(self, arrival_time, attr=None): """ - given the arrival time matrix, this function sort the matrix and return the index matrix in the order of arrival time + Given the arrival time matrix, this function sort the matrix and return the index matrix in the order of + arrival time """ n, m = arrival_time.shape if self._feature_config.attention_order == "ramdom": @@ -128,27 +130,26 @@ def end_ep_callback(self, snapshot_list): self.last_tick = -1 def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): - """ - this function update the state_dict from snapshot_list in the given tick_range - """ + """This function update the state_dict from snapshot_list in the given tick_range. """ if len(tick_range) == 0: - # this occurs when two actions happen at the same tick + # this occurs when two actions happen at the same tick. return - # one dim features + # one dim features. port_naive_feature = snapshot_list["ports"][tick_range: self.port_code_list: self.port_features] \ .reshape(len(tick_range), self.port_cnt, -1) - # number of laden from source to destination - full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape(len(tick_range), self.port_cnt, self.port_cnt) - # normalize features to a small range + # number of laden from source to destination. + full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape(len(tick_range), self.port_cnt, + self.port_cnt) + # normalize features to a small range. # port_state_mat = self.normalize(np.concatenate([port_naive_feature, full_on_port], axis=2)) port_state_mat = self.normalize(port_naive_feature) if self._feature_config.onehot_identity: - # add onehot vector to identify port and vessel + # add onehot vector to identify port and vessel. port_onehot = np.repeat(self.port_one_hot_coding, len(tick_range), axis=0) if static_code is not None and dynamic_code is not None: - # identify the decision vessel at the decision port + # identify the decision vessel at the decision port. # print(dynamic_code, self.node_code_inv_dict_v[dynamic_code]) port_onehot[-1, self.port_code_inv_dict[static_code], self.node_code_inv_dict_v[dynamic_code]] = -1 port_state_mat = np.concatenate([port_state_mat, port_onehot], axis=2) @@ -156,7 +157,8 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami vessel_naive_feature = snapshot_list["vessels"][tick_range:self.vessel_code_list: self.vessel_features] \ .reshape(len(tick_range), self.vessel_cnt, -1) - full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape(len(tick_range), self.vessel_cnt, self.port_cnt) + full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape(len(tick_range), + self.vessel_cnt, self.port_cnt) # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) vessel_state_mat = self.normalize(vessel_naive_feature) @@ -191,7 +193,7 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): assert((action_info is not None and snapshot_list is not None) or tick is not None) if action_info is not None and snapshot_list is not None: - # update the state dict + # update the state dict. static_code = action_info.port_idx dynamic_code = action_info.vessel_idx if self.last_tick == action_info.tick: @@ -204,7 +206,7 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): self._sync_raw_features(snapshot_list, tick_range, static_code, dynamic_code) tick = action_info.tick - # state_tick_range is inverse order + # state_tick_range is inverse order. state_tick_range = np.arange(tick, max(-1, tick-self._tick_buffer), -1) # print(state_tick_range) v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim("v"))) @@ -212,7 +214,7 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim("p"))) p[:len(state_tick_range)] = self._state_dict["p"][state_tick_range] - # true means padding + # true means padding. mask = np.ones(self._tick_buffer, dtype=np.bool) mask[:len(state_tick_range)] = False ret = { diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 51169d0c2..447376280 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -8,13 +8,12 @@ import torch from torch.optim.lr_scheduler import LambdaLR -from maro.simulator.scenarios.cim.common import Action, DecisionEvent from maro.simulator import Env +from maro.simulator.scenarios.cim.common import Action, DecisionEvent from maro.utils import convert_dottable, clone def compute_v2p_degree_matrix(env): - """This function compute the adjacent matrix - """ + """This function compute the adjacent matrix. """ topo_config = env.configs static_dict = env.summary["node_mapping"]["ports"] dynamic_dict = env.summary["node_mapping"]["vessels"] @@ -121,8 +120,7 @@ def flatten_embedding(embedding, batch_range, edge=None): return ret, edge def log2json(file_path): - """load the log file as a json list. - """ + """load the log file as a json list. """ with open(file_path, "r") as fp: lines = fp.read().splitlines() From 7da898d89159f9a0b651f3bc31b9b8b19323930f Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Thu, 15 Oct 2020 17:51:31 +0800 Subject: [PATCH 13/25] refine again --- examples/cim/gnn/actor.py | 6 ------ examples/cim/gnn/state_shaper.py | 3 --- examples/cim/gnn/utils.py | 1 - 3 files changed, 10 deletions(-) diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 44375d026..fe5a260f9 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -162,7 +162,6 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou r, decision_event, is_done = env.step(action) j += 1 action_io_np["sh"][index] = compute_shortage(env.snapshot_list, config.env.param.durations, static_code_list) - # print("one ep done!") i += 1 pipe.send("done") gnn_state_shaper.end_ep_callback(env.snapshot_list) @@ -310,7 +309,6 @@ def roll_out(self): if signals[0] == "done": break - # print("step: %d"%step_i) step_i += 1 t = time.time() @@ -320,7 +318,6 @@ def roll_out(self): self.action_io_np["mask"], self.device) t_state += time.time() - t - # print(self.action_io_np["pid"]) assert(np.min(self.action_io_np["pid"]) == np.max(self.action_io_np["pid"])) assert(np.min(self.action_io_np["vid"]) == np.max(self.action_io_np["vid"])) @@ -333,7 +330,6 @@ def roll_out(self): p[0].send(actions[i]) self._roll_out_time += time.time() - tick - # print(self.exp_output_np["len"]) tick = time.time() self._logger.info("receiving exp") logs = [p[0].recv() for p in self.pipes] @@ -343,12 +339,10 @@ def roll_out(self): self._logger.debug(dict(zip(self.log_header, self.action_io_np["sh"]))) - # print(loged_dict) with open(os.path.join(self.config.log.path, "logs_%d"%self._roll_out_cnt), "wb") as fp: pickle.dump(logs, fp) - self._logger.info("organize exp_dict") result = organize_exp_list(self.exp_output_np, self.exp_idx_mapping) diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index 7c83f1ada..c08c940cb 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -150,7 +150,6 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami port_onehot = np.repeat(self.port_one_hot_coding, len(tick_range), axis=0) if static_code is not None and dynamic_code is not None: # identify the decision vessel at the decision port. - # print(dynamic_code, self.node_code_inv_dict_v[dynamic_code]) port_onehot[-1, self.port_code_inv_dict[static_code], self.node_code_inv_dict_v[dynamic_code]] = -1 port_state_mat = np.concatenate([port_state_mat, port_onehot], axis=2) self._state_dict["p"][tick_range] = port_state_mat @@ -202,13 +201,11 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): tick_range = list(range(self.last_tick+1, action_info.tick+1, 1)) self.last_tick = action_info.tick - # print(static_code, dynamic_code) self._sync_raw_features(snapshot_list, tick_range, static_code, dynamic_code) tick = action_info.tick # state_tick_range is inverse order. state_tick_range = np.arange(tick, max(-1, tick-self._tick_buffer), -1) - # print(state_tick_range) v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim("v"))) v[:len(state_tick_range)] = self._state_dict["v"][state_tick_range] p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim("p"))) diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 447376280..84ba6239f 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -161,7 +161,6 @@ def random_shortage(env, tick, action_dim=21): else: actual_action = int(1.0*action_idx/zero_idx*discharge) """ - # print(action_idx, -load, actual_action, discharge) action = Action(pa.vessel_idx, pa.port_idx, 0) r, pa, is_done = env.step(action) From f9c779f34d011802243c87eea73f12efffeb3252 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Thu, 15 Oct 2020 18:42:01 +0800 Subject: [PATCH 14/25] refine the format --- .github/linters/tox.ini | 1 - .../cim/dqn/components/experience_shaper.py | 2 +- examples/cim/dqn/dist_actor.py | 3 +- examples/cim/dqn/single_process_launcher.py | 3 +- examples/cim/gnn/action_shaper.py | 10 ++- examples/cim/gnn/actor.py | 71 +++++++++--------- examples/cim/gnn/actor_critic.py | 11 +-- examples/cim/gnn/agent.py | 1 + examples/cim/gnn/agent_manager.py | 60 ++++++++------- examples/cim/gnn/experience_shaper.py | 74 +++++++++--------- examples/cim/gnn/launcher.py | 4 +- examples/cim/gnn/learner.py | 14 ++-- examples/cim/gnn/numpy_store.py | 13 ++-- examples/cim/gnn/shared_structure.py | 3 + examples/cim/gnn/simple_gnn.py | 75 +++++++++++-------- examples/cim/gnn/state_shaper.py | 46 ++++++------ examples/cim/gnn/utils.py | 58 +++++++++----- 17 files changed, 243 insertions(+), 206 deletions(-) diff --git a/.github/linters/tox.ini b/.github/linters/tox.ini index 82b8f1c24..339c0d9b2 100644 --- a/.github/linters/tox.ini +++ b/.github/linters/tox.ini @@ -14,7 +14,6 @@ exclude = build, dist, *.egg-info, - examples, docker_files, .vscode, .github, diff --git a/examples/cim/dqn/components/experience_shaper.py b/examples/cim/dqn/components/experience_shaper.py index 2941f2159..4d82b5233 100644 --- a/examples/cim/dqn/components/experience_shaper.py +++ b/examples/cim/dqn/components/experience_shaper.py @@ -41,7 +41,7 @@ def _compute_reward(self, decision_event, snapshot_list): future_fulfillment = snapshot_list["ports"][ticks::"fulfillment"] future_shortage = snapshot_list["ports"][ticks::"shortage"] decay_list = [self._time_decay_factor ** i for i in range(end_tick - start_tick) - for _ in range(future_fulfillment.shape[0]//(end_tick-start_tick))] + for _ in range(future_fulfillment.shape[0] // (end_tick - start_tick))] tot_fulfillment = np.dot(future_fulfillment, decay_list) tot_shortage = np.dot(future_shortage, decay_list) diff --git a/examples/cim/dqn/dist_actor.py b/examples/cim/dqn/dist_actor.py index 350f493f2..06d466112 100644 --- a/examples/cim/dqn/dist_actor.py +++ b/examples/cim/dqn/dist_actor.py @@ -21,7 +21,8 @@ if config.experience_shaping.type == "truncated": experience_shaper = TruncatedExperienceShaper(**config.experience_shaping.truncated) else: - experience_shaper = KStepExperienceShaper(reward_func=lambda mt: 1-mt["container_shortage"]/mt["order_requirements"], + experience_shaper = KStepExperienceShaper(reward_func=lambda mt: 1 - mt["container_shortage"] / + mt["order_requirements"], **config.experience_shaping.k_step) exploration_config = {"epsilon_range_dict": {"_all_": config.exploration.epsilon_range}, diff --git a/examples/cim/dqn/single_process_launcher.py b/examples/cim/dqn/single_process_launcher.py index a906513ea..5e80df041 100644 --- a/examples/cim/dqn/single_process_launcher.py +++ b/examples/cim/dqn/single_process_launcher.py @@ -29,7 +29,8 @@ if config.experience_shaping.type == "truncated": experience_shaper = TruncatedExperienceShaper(**config.experience_shaping.truncated) else: - experience_shaper = KStepExperienceShaper(reward_func=lambda mt: 1-mt["container_shortage"]/mt["order_requirements"], + experience_shaper = KStepExperienceShaper(reward_func=lambda mt: 1 - mt["container_shortage"] / + mt["order_requirements"], **config.experience_shaping.k_step) exploration_config = {"epsilon_range_dict": {"_all_": config.exploration.epsilon_range}, diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 90451c019..435f21e82 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -1,5 +1,6 @@ from maro.rl import ActionShaper + class DiscreteActionShaper(ActionShaper): """The shaping class to transform the action in [-1, 1] to actual repositioning function. """ def __init__(self, action_dim): @@ -7,7 +8,7 @@ def __init__(self, action_dim): self._action_dim = action_dim self._zero_action = self._action_dim // 2 - def __call__(self, pending_action, model_action): + def __call__(self, decision_event, model_action): """Shaping the action in [-1,1] range to the actual repositioning function. This function maps integer model action within the range of [-A, A] to actual action. We define negative actual @@ -18,12 +19,12 @@ def __call__(self, pending_action, model_action): pending_action (Event): The decision event from the environment. model_action (int): Output action, range A means the half of the agent output dim. """ - tick = pending_action.tick + # tick = pending_action.tick env_action = 0 - action_index = model_action + # action_index = model_action model_action -= self._zero_action - action_scope = pending_action.action_scope + action_scope = decision_event.action_scope if model_action < 0: # Discharge resource from dynamic node. @@ -38,3 +39,4 @@ def __call__(self, pending_action, model_action): return env_action + diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index fe5a260f9..e4dd4d942 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -1,26 +1,25 @@ import ctypes import multiprocessing -import time, os, pickle -from collections import defaultdict, OrderedDict -from multiprocessing import Process, Pipe, Event, Manager +import os +import pickle +import time +from collections import OrderedDict +from multiprocessing import Process, Pipe import numpy as np import torch -from examples.cim.gnn.actor_critic import ActorCritic from examples.cim.gnn.action_shaper import DiscreteActionShaper -from examples.cim.gnn.utils import decision_cnt_analysis, compute_v2p_degree_matrix from examples.cim.gnn.utils import fix_seed, gnn_union from examples.cim.gnn.experience_shaper import ExperienceShaper from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.shared_structure import SharedStructure from maro.rl import AbsActor from maro.simulator import Env -from maro.simulator.scenarios.cim.common import Action, DecisionEvent -from maro.utils import Logger, LogFormat, convert_dottable +from maro.simulator.scenarios.cim.common import Action -def organize_exp_list(experience_collections:dict, idx_mapping:dict): +def organize_exp_list(experience_collections: dict, idx_mapping: dict): """The function assemble the experience from multiple processes into a dictionary. Args: @@ -56,9 +55,9 @@ def organize_exp_list(experience_collections:dict, idx_mapping:dict): s = organize_obs(experience_collections["s"], idx, exp_len) s_ = organize_obs(experience_collections["s_"], idx, exp_len) - R = experience_collections["R"][idx:idx+exp_len] + R = experience_collections["R"][idx: idx + exp_len] R = R.reshape(-1, *R.shape[2:]) - a = experience_collections["a"][idx:idx+exp_len] + a = experience_collections["a"][idx: idx + exp_len] a = a.reshape(-1, *a.shape[2:]) result[code] = { @@ -77,29 +76,28 @@ def organize_obs(obs, idx, exp_len): _, _, _, p_cnt, p_dim = obs["p"].shape batch = exp_len * para_cnt # v: tick_buffer, seq_len, parallel_cnt, v_cnt, v_dim --> (tick_buffer, cnt, v_cnt, v_dim) - v = obs["v"][:, idx: idx+exp_len] + v = obs["v"][:, idx: idx + exp_len] v = v.reshape(tick_buffer, batch, v_cnt, v_dim) - p = obs["p"][:, idx: idx+exp_len] + p = obs["p"][:, idx: idx + exp_len] p = p.reshape(tick_buffer, batch, p_cnt, p_dim) # vo: seq_len * parallel_cnt * v_cnt * p_cnt* --> cnt * v_cnt * p_cnt* - vo = obs["vo"][idx: idx+exp_len] + vo = obs["vo"][idx: idx + exp_len] vo = vo.reshape(batch, v_cnt, vo.shape[-1]) - po = obs["po"][idx: idx+exp_len] + po = obs["po"][idx: idx + exp_len] po = po.reshape(batch, p_cnt, po.shape[-1]) - vedge = obs["vedge"][idx: idx+exp_len] + vedge = obs["vedge"][idx: idx + exp_len] vedge = vedge.reshape(batch, v_cnt, vedge.shape[-2], vedge.shape[-1]) - pedge = obs["pedge"][idx: idx+exp_len] + pedge = obs["pedge"][idx: idx + exp_len] pedge = pedge.reshape(batch, p_cnt, pedge.shape[-2], pedge.shape[-1]) - ppedge = obs["ppedge"][idx: idx+exp_len] + ppedge = obs["ppedge"][idx: idx + exp_len] ppedge = ppedge.reshape(batch, p_cnt, ppedge.shape[-2], ppedge.shape[-1]) # mask: (seq_len, parallel_cnt, tick_buffer) - mask = obs["mask"][idx: idx+exp_len].reshape(batch, tick_buffer) + mask = obs["mask"][idx: idx + exp_len].reshape(batch, tick_buffer) return {"v": v, "p": p, "vo": vo, "po": po, "pedge": pedge, "vedge": vedge, "ppedge": ppedge, "mask": mask} - def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_output): """The A2C worker function to collect experience. @@ -117,7 +115,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou env = Env(**config.env.param) fix_seed(env, config.env.seed) static_code_list, dynamic_code_list = list(env.summary["node_mapping"]["ports"].values()), \ - list(env.summary["node_mapping"]["vessels"].values()) + list(env.summary["node_mapping"]["vessels"].values()) # create gnn_state_shaper without consuming any resources gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, @@ -129,9 +127,9 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou action_shaper = DiscreteActionShaper(config.model.action_dim) exp_shaper = ExperienceShaper(static_code_list, dynamic_code_list, config.env.param.durations, gnn_state_shaper, - scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, - discount_factor=config.training.gamma, idx=index, - shared_storage=exp_output.structuralize(), exp_idx_mapping=exp_idx_mapping) + scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, + discount_factor=config.training.gamma, idx=index, + shared_storage=exp_output.structuralize(), exp_idx_mapping=exp_idx_mapping) i = 0 while pipe.recv() == "reset": @@ -156,8 +154,8 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou model_action = pipe.recv() env_action = action_shaper(decision_event, model_action) exp_shaper.record(pending_action=decision_event, model_action=model_action, model_input=model_input) - logs.append([index, decision_event.tick, decision_event.port_idx, decision_event.vessel_idx, model_action, env_action, decision_event.action_scope.load, - decision_event.action_scope.discharge]) + logs.append([index, decision_event.tick, decision_event.port_idx, decision_event.vessel_idx, model_action, + env_action, decision_event.action_scope.load, decision_event.action_scope.discharge]) action = Action(decision_event.vessel_idx, decision_event.port_idx, env_action) r, decision_event, is_done = env.step(action) j += 1 @@ -171,12 +169,12 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou logs = np.array(logs, dtype=np.float) pipe.send(logs) - print("the end") def compute_shortage(snapshot_list, max_tick, static_code_list): """Helper function to compute the shortage after a episode end. """ - return np.sum(snapshot_list["ports"][max_tick-1: static_code_list: "acc_shortage"]) + return np.sum(snapshot_list["ports"][max_tick - 1: static_code_list: "acc_shortage"]) + class ParallelActor(AbsActor): def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): @@ -213,9 +211,9 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): action_dim = config.model.action_dim v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim("v"), \ - self._gnn_state_shaper.get_input_dim("vedge"), len(self._dynamic_node_mapping) + self._gnn_state_shaper.get_input_dim("vedge"), len(self._dynamic_node_mapping) p_dim, pedge_dim, p_cnt = self._gnn_state_shaper.get_input_dim("p"), \ - self._gnn_state_shaper.get_input_dim("pedge"), len(self._static_node_mapping) + self._gnn_state_shaper.get_input_dim("pedge"), len(self._static_node_mapping) self.pipes = [Pipe() for i in range(self.parallel_cnt)] @@ -275,8 +273,7 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self.workers = [Process( target=single_player_worker, args=(i, config, self.exp_idx_mapping, self.pipes[i][1], - self.action_io, self.exp_output)) - for i in range(self.parallel_cnt)] + self.action_io, self.exp_output)) for i in range(self.parallel_cnt)] for w in self.workers: w.start() @@ -313,17 +310,17 @@ def roll_out(self): t = time.time() graph = gnn_union(self.action_io_np["p"], self.action_io_np["po"], self.action_io_np["pedge"], - self.action_io_np["v"], self.action_io_np["vo"], self.action_io_np["vedge"], - self._gnn_state_shaper.p2p_static_graph, self.action_io_np["ppedge"], - self.action_io_np["mask"], self.device) + self.action_io_np["v"], self.action_io_np["vo"], self.action_io_np["vedge"], + self._gnn_state_shaper.p2p_static_graph, self.action_io_np["ppedge"], + self.action_io_np["mask"], self.device) t_state += time.time() - t assert(np.min(self.action_io_np["pid"]) == np.max(self.action_io_np["pid"])) assert(np.min(self.action_io_np["vid"]) == np.max(self.action_io_np["vid"])) t = time.time() - actions = self._inference_agents.choose_action(agent_id = (self.action_io_np["pid"][0], - self.action_io_np["vid"][0]), state=graph) + actions = self._inference_agents.choose_action(agent_id=(self.action_io_np["pid"][0], + self.action_io_np["vid"][0]), state=graph) t_action += time.time() - t for i, p in enumerate(self.pipes): @@ -337,7 +334,6 @@ def roll_out(self): self._logger.info("Mean of shortage: %f" % np.mean(self.action_io_np["sh"])) self._trainsfer_time += time.time() - tick - self._logger.debug(dict(zip(self.log_header, self.action_io_np["sh"]))) with open(os.path.join(self.config.log.path, "logs_%d"%self._roll_out_cnt), "wb") as fp: @@ -359,3 +355,4 @@ def exit(self): for p in self.pipes: p[0].send("close") + diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index f68c4c480..eee7030cb 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -8,6 +8,7 @@ from examples.cim.gnn.utils import gnn_union from maro.rl import AbsAlgorithm + class ActorCritic(AbsAlgorithm): """Actor-Critic algorithm in CIM problem. @@ -134,9 +135,9 @@ def train(self, batch, p_idx, v_idx): if self._entropy_factor != 0: # actor_loss = actor_loss* torch.log(entropy_loss + np.e) - advantage[:, p_idx] += self._entropy_factor*entropy_loss.detach() + advantage[:, p_idx] += self._entropy_factor * entropy_loss.detach() - actor_loss = - (log_prob*torch.sum(advantage, axis=-1).detach()).mean() + actor_loss = - (log_prob * torch.sum(advantage, axis=-1).detach()).mean() # actor_loss.backward(retain_graph=True) # self._actor_optimizer["a&c"].step() @@ -150,7 +151,7 @@ def train(self, batch, p_idx, v_idx): item_c_loss = critic_loss.item() # torch.nn.utils.clip_grad_norm_(self._critic_model.parameters(),0.5) # self._critic_optimizer["a&c"].step() - tot_loss = 0.1*actor_loss + critic_loss # - self._entropy_factor * entropy_loss + tot_loss = 0.1 * actor_loss + critic_loss # - self._entropy_factor * entropy_loss tot_loss.backward() tot_norm = clip_grad.clip_grad_norm_(self._model_dict["a&c"].parameters(), 1) self._optimizer["a&c"].step() @@ -168,7 +169,7 @@ def _get_save_idx(self, fp_str): def save_model(self, pth, id): if not os.path.exists(pth): os.makedirs(pth) - pth = os.path.join(pth, "%d_ac.pkl"%id) + pth = os.path.join(pth, "%d_ac.pkl" % id) torch.save(self._model_dict["a&c"].state_dict(), pth) def _set_gnn_weights(self, weights): @@ -183,7 +184,7 @@ def load_model(self, folder_pth, idx=-1): fps.sort(key=self._get_save_idx) ac_pth = fps[-1] else: - ac_pth = "%d_ac.pkl"%idx + ac_pth = "%d_ac.pkl" % idx pth = os.path.join(folder_pth, ac_pth) with open(pth, "rb") as fp: weights = torch.load(fp, map_location=self._device) diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index dfc75abc7..c3899903d 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -7,6 +7,7 @@ from maro.rl import AbsAgent from maro.utils import DummyLogger + class TrainableAgent(AbsAgent): def __init__(self, name, algorithm, experience_pool, logger=DummyLogger()): self._logger = logger diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index 9719f3eb7..b2e36e496 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -8,55 +8,57 @@ from examples.cim.gnn.simple_gnn import SharedAC from examples.cim.gnn.numpy_store import NumpyStore from examples.cim.gnn.state_shaper import GNNStateShaper -from examples.cim.gnn.utils import compute_v2p_degree_matrix from maro.rl import AbsAgentManager, AgentMode from maro.utils import DummyLogger + class SimpleAgentManger(AbsAgentManager): - def __init__(self, name, - agent_id_list, - port_code_list, - vessel_code_list, - demo_env, - state_shaper:GNNStateShaper, - logger=DummyLogger()): - super().__init__(name, - AgentMode.TRAIN, - agent_id_list, - state_shaper=state_shaper, - action_shaper=None, - experience_shaper=None, - explorer=None) + def __init__(self, name, agent_id_list, ort_code_list, vessel_code_list, demo_env, state_shaper: GNNStateShaper, + logger=DummyLogger()): + super().__init__(name, AgentMode.TRAIN, agent_id_list, state_shaper=state_shaper, action_shaper=None, + experience_shaper=None, explorer=None) self.port_code_list = copy(port_code_list) self.vessel_code_list = copy(vessel_code_list) self.demo_env = demo_env self._logger = logger def assemble(self, config): - v_dim, vedge_dim, v_cnt = self._state_shaper.get_input_dim("v"), self._state_shaper.get_input_dim("vedge"), len(self.vessel_code_list) - p_dim, pedge_dim, p_cnt = self._state_shaper.get_input_dim("p"), self._state_shaper.get_input_dim("pedge"), len(self.port_code_list) + v_dim, vedge_dim = self._state_shaper.get_input_dim("v"), self._state_shaper.get_input_dim("vedge") + p_dim, pedge_dim, p_cnt = self._state_shaper.get_input_dim("p"), self._state_shaper.get_input_dim("pedge"), + len(self.port_code_list) self.device = torch.device(config.training.device) self._logger.info(config.training.device) - ac_model = SharedAC(p_dim, pedge_dim, v_dim, vedge_dim, config.model.tick_buffer, config.model.action_dim).to(self.device) + ac_model = SharedAC(p_dim, pedge_dim, v_dim, vedge_dim, config.model.tick_buffer, config.model.action_dim). \ + to(self.device) value_dict = { - ("s", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), np.float32, False), - ("s", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), np.float32, False), + ("s", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), + np.float32, False), + ("s", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), + np.float32, False), ("s", "vo"): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), ("s", "po"): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), - ("s", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("pedge")), np.float32, True), + ("s", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), + self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), + self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), + self._state_shaper.get_input_dim("pedge")), np.float32, True), ("s", "mask"): ((config.model.tick_buffer, ), np.bool, True), - ("s_", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), np.float32, False), - ("s_", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), np.float32, False), + ("s_", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), + np.float32, False), + ("s_", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), + np.float32, False), ("s_", "vo"): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), ("s_", "po"): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), - ("s_", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s_", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s_", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("pedge")), np.float32, True), + ("s_", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), + self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s_", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), + self._state_shaper.get_input_dim("vedge")), np.float32, True), + ("s_", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), + self._state_shaper.get_input_dim("pedge")), np.float32, True), ("s_", "mask"): ((config.model.tick_buffer, ), np.bool, True), # to identify one dimension variable @@ -69,7 +71,7 @@ def assemble(self, config): learning_rate=config.training.learning_rate) for agent_id, cnt in config.env.exp_per_ep.items(): - experience_pool = NumpyStore(value_dict, config.training.parallel_cnt*config.training.train_freq * cnt) + experience_pool = NumpyStore(value_dict, config.training.parallel_cnt * config.training.train_freq * cnt) self._agent_dict[agent_id] = TrainableAgent(agent_id, self._algorithm, experience_pool, self._logger) def choose_action(self, agent_id, state): diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index 7ee757866..b06534c5f 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -2,9 +2,10 @@ import numpy as np + class ExperienceShaper: def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, - discount_factor=0.97, idx=-1, shared_storage=None, exp_idx_mapping=None): + discount_factor=0.97, idx=-1, shared_storage=None, exp_idx_mapping=None): self._static_list = list(static_list) self._dynamic_list = list(dynamic_list) self._time_slot = time_slot @@ -23,7 +24,7 @@ def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_ self._scale_factor = scale_factor def _init_state(self): - self._fulfillment_list, self._shortage_list = np.zeros(self._max_tick+1), np.zeros(self._max_tick+1) + self._fulfillment_list, self._shortage_list = np.zeros(self._max_tick + 1), np.zeros(self._max_tick + 1) self._experience_dict = defaultdict(list) self._last_tick = 0 @@ -54,58 +55,59 @@ def __call__(self, snapshot_list): shortage = snapshot_list["ports"][self._tick_range:self._static_list:"shortage"].reshape(self._max_tick, -1) fulfillment = snapshot_list["ports"][self._tick_range:self._static_list:"fulfillment"] \ - .reshape(self._max_tick, -1) + .reshape(self._max_tick, -1) # tot_shortage = np.sum(shortage, axis=1) # tot_fulfillment = np.sum(fulfillment, axis=1) delta = fulfillment - shortage R = np.empty((self._len_return, len(self._static_list)), dtype=np.float) for i in range(0, self._len_return, 1): - R[i] = np.dot(self._discount_vector, delta[i+1: i+self._time_slot+1]) + R[i] = np.dot(self._discount_vector, delta[i + 1: i + self._time_slot + 1]) # pkl.dump(R, open(r"/data/log/replay/R2.pkl", "wb")) for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): for exp in exp_list: tick = exp["tick"] - exp["s_"] = self._gnn_state_shaper(tick=tick+self._time_slot) - exp["R"] = self._scale_factor*R[tick] + exp["s_"] = self._gnn_state_shaper(tick=tick + self._time_slot) + exp["R"] = self._scale_factor * R[tick] tmpi = 0 for (agent_idx, vessel_idx), idx_base in self._exp_idx_mapping.items(): - # for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): + # for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): exp_list = self._experience_dict[(agent_idx, vessel_idx)] exp_len = len(exp_list) # here, we assume that exp_idx_mapping order is not changed. self._shared_storage["len"][self._idx, tmpi] = exp_len - self._shared_storage["s"]["v"][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s"]["v"] for e in exp_list], axis=1) - self._shared_storage["s"]["p"][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s"]["p"] for e in exp_list], axis=1) - self._shared_storage["s"]["vo"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s"]["vo"] for e in exp_list], axis=0) - self._shared_storage["s"]["po"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s"]["po"] for e in exp_list], axis=0) - self._shared_storage["s"]["vedge"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s"]["vedge"] for e in exp_list], axis=0) - self._shared_storage["s"]["pedge"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s"]["pedge"] for e in exp_list], axis=0) - - self._shared_storage["s_"]["v"][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s_"]["v"] for e in exp_list], axis=1) - self._shared_storage["s_"]["p"][:, idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s_"]["p"] for e in exp_list], axis=1) - self._shared_storage["s_"]["vo"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s_"]["vo"] for e in exp_list], axis=0) - self._shared_storage["s_"]["po"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s_"]["po"] for e in exp_list], axis=0) - self._shared_storage["s_"]["vedge"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s_"]["vedge"] for e in exp_list], axis=0) - self._shared_storage["s_"]["pedge"][idx_base:idx_base+exp_len, self._idx] = \ - np.stack([e["s_"]["pedge"] for e in exp_list], axis=0) - - self._shared_storage["a"][idx_base:idx_base+exp_len, self._idx] = \ - np.array([exp["a"] for exp in exp_list], dtype=np.int64) - self._shared_storage["R"][idx_base:idx_base+exp_len, self._idx] = np.vstack([exp["R"] for exp in exp_list]) + self._shared_storage["s"]["v"][:, idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s"]["v"] for e in exp_list], axis=1) + self._shared_storage["s"]["p"][:, idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s"]["p"] for e in exp_list], axis=1) + self._shared_storage["s"]["vo"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s"]["vo"] for e in exp_list], axis=0) + self._shared_storage["s"]["po"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s"]["po"] for e in exp_list], axis=0) + self._shared_storage["s"]["vedge"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s"]["vedge"] for e in exp_list], axis=0) + self._shared_storage["s"]["pedge"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s"]["pedge"] for e in exp_list], axis=0) + + self._shared_storage["s_"]["v"][:, idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s_"]["v"] for e in exp_list], axis=1) + self._shared_storage["s_"]["p"][:, idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s_"]["p"] for e in exp_list], axis=1) + self._shared_storage["s_"]["vo"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s_"]["vo"] for e in exp_list], axis=0) + self._shared_storage["s_"]["po"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s_"]["po"] for e in exp_list], axis=0) + self._shared_storage["s_"]["vedge"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s_"]["vedge"] for e in exp_list], axis=0) + self._shared_storage["s_"]["pedge"][idx_base:idx_base + exp_len, self._idx] = \ + np.stack([e["s_"]["pedge"] for e in exp_list], axis=0) + + self._shared_storage["a"][idx_base: idx_base + exp_len, self._idx] = \ + np.array([exp["a"] for exp in exp_list], dtype=np.int64) + self._shared_storage["R"][idx_base: idx_base + exp_len, self._idx] = \ + np.vstack([exp["R"] for exp in exp_list]) tmpi += 1 # pkl.dump(self._exp_idx_mapping, open(r"/data/log/replay/order2.pkl", "wb")) diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 9c5561efd..9ac472b94 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -17,7 +17,7 @@ # generate log path. date_str = datetime.datetime.now().strftime("%Y%m%d") time_str = datetime.datetime.now().strftime("%H%M%S.%f") - subfolder_name = "%s_%s"%(config.env.param.topology, time_str) + subfolder_name = "%s_%s" % (config.env.param.topology, time_str) # log path. config.log.path = os.path.join(config.log.path, date_str, subfolder_name) @@ -35,7 +35,7 @@ # add some buffer to prevent overlapping config.env.return_scaler, tot_order_amount = return_scaler(demo_env, tick=config.env.param.durations, gamma=config.training.gamma) - simulation_logger.info("Return value will be scaled down by the factor %f"%config.env.return_scaler) + simulation_logger.info("Return value will be scaled down by the factor %f" % config.env.return_scaler) save_config(config, os.path.join(config.log.path, "config.yml")) save_code("examples/cim/gnn", config.log.path) diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index 7837d699b..28bd53514 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -6,6 +6,7 @@ from maro.rl import AbsLearner from maro.utils import DummyLogger + class GNNLearner(AbsLearner): """Learner class for the training pipeline and the specialized logging in GNN solution for CIM problem. @@ -15,7 +16,7 @@ class GNNLearner(AbsLearner): logger (Logger): The logger to save/print the message. """ - def __init__(self, actor: ParallelActor, trainable_agents:SimpleAgentManger, logger=DummyLogger()): + def __init__(self, actor: ParallelActor, trainable_agents: SimpleAgentManger, logger=DummyLogger()): super().__init__() self._actor = actor self._trainable_agents = trainable_agents @@ -25,7 +26,7 @@ def train(self, training_config, log_pth=None): rollout_time = 0 training_time = 0 for i in range(training_config.rollout_cnt): - self._logger.info("rollout %d"%(i+1)) + self._logger.info("rollout %d" % (i + 1)) tick = time.time() exp_dict = self._actor.roll_out() @@ -34,20 +35,19 @@ def train(self, training_config, log_pth=None): self._logger.info("start putting exps") self._trainable_agents.store_experiences(exp_dict) - if training_config.enable and i % training_config.train_freq == training_config.train_freq-1: + if training_config.enable and i % training_config.train_freq == training_config.train_freq - 1: tick = time.time() # for code, exp_pool in experience_pool_dict.items(): - loss_dict = self._trainable_agents.train(training_config) + # loss_dict = self._trainable_agents.train(training_config) training_time += time.time() - tick - if log_pth is not None and (i+1) % training_config.model_save_freq == 0: - self._trainable_agents.save_model(os.path.join(log_pth, "models"), i+1) + if log_pth is not None and (i + 1) % training_config.model_save_freq == 0: + self._trainable_agents.save_model(os.path.join(log_pth, "models"), i + 1) self._logger.debug("total rollout_time: %d" % int(rollout_time)) self._logger.debug("train_time: %d" % int(training_time)) - def test(self): pass diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index 300a7591f..b485d2918 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -71,14 +71,13 @@ def __init__(self, domain_type_dict, capacity): """ super().__init__() self.domain_type_dict = dict(domain_type_dict) - self.store = {key: np.zeros(shape=(capacity, *shape) if batch_first else (shape[0], capacity, *shape[1:]), dtype=data_type) - for key, (shape, data_type, batch_first) in domain_type_dict.items()} + self.store = {key: np.zeros(shape=(capacity, *shape) if batch_first else (shape[0], capacity, *shape[1:]), + dtype=data_type) for key, (shape, data_type, batch_first) in domain_type_dict.items()} self.batch_first_store = {key: batch_first for key, (_, _, batch_first) in domain_type_dict.items()} self.cnt = 0 self.capacity = capacity - def put(self, exp_dict: dict): """Insert a batch of experience into the store @@ -108,10 +107,10 @@ def put(self, exp_dict: dict): for key in self.domain_type_dict.keys(): data = get_item(exp_dict, key) if self.batch_first_store[key]: - self.store[key][self.cnt: self.cnt+append_end] = data[0:append_end] + self.store[key][self.cnt: self.cnt + append_end] = data[0: append_end] else: - self.store[key][:, self.cnt: self.cnt+append_end] = data[:, 0:append_end] - idxs[: append_end] = np.arange(self.cnt, self.cnt+append_end) + self.store[key][:, self.cnt: self.cnt + append_end] = data[:, 0: append_end] + idxs[: append_end] = np.arange(self.cnt, self.cnt + append_end) if append_end < dlen: replace_idx = self._get_replace_idx(dlen - append_end) for key in self.domain_type_dict.keys(): @@ -127,7 +126,7 @@ def put(self, exp_dict: dict): def _get_replace_idx(self, cnt): return np.random.randint(low=0, high=self.capacity, size=cnt) - def get(self, indexes:np.array): + def get(self, indexes: np.array): """Get the experience indexed in the indexes list from the store Args: diff --git a/examples/cim/gnn/shared_structure.py b/examples/cim/gnn/shared_structure.py index d7049dfe8..296a4d420 100644 --- a/examples/cim/gnn/shared_structure.py +++ b/examples/cim/gnn/shared_structure.py @@ -2,6 +2,7 @@ import numpy as np + def init_shared_memory(data_structure): # data_structure should be a dict like: # { @@ -21,6 +22,7 @@ def init_shared_memory(data_structure): shared_data[k] = init_shared_memory(v) return shared_data + def shared_data2numpy(shared_data, structure_info): if not isinstance(shared_data, dict): return np.frombuffer(shared_data, dtype=structure_info[1]).reshape(structure_info[0]) @@ -30,6 +32,7 @@ def shared_data2numpy(shared_data, structure_info): numpy_dict[k] = shared_data2numpy(v, structure_info[k]) return numpy_dict + class SharedStructure: def __init__(self, data_structure): self.data_structure = data_structure diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index f9b8c939a..6ed90ce25 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -9,6 +9,7 @@ from torch.nn.modules.dropout import Dropout from torch.nn.modules.normalization import LayerNorm + class PositionalEncoder(nn.Module): """ The positional encoding used in transformer to get the sequential information. @@ -17,10 +18,10 @@ class PositionalEncoder(nn.Module): https://pytorch.org/tutorials/beginner/transformer_tutorial.html?highlight=positionalencoding """ - def __init__(self, d_model, max_seq_len = 80): + def __init__(self, d_model, max_seq_len=80): super().__init__() self.d_model = d_model - self.times = 4*math.sqrt(self.d_model) + self.times = 4 * math.sqrt(self.d_model) # create constant "pe" matrix with values dependant on # pos and i @@ -30,14 +31,15 @@ def __init__(self, d_model, max_seq_len = 80): self.pe[pos, i] = math.sin(pos / (10000 ** ((2 * i) / d_model))) self.pe[pos, i + 1] = math.cos(pos / (10000 ** ((2 * (i + 1)) / d_model))) - self.pe = self.pe.unsqueeze(1)/self.d_model + self.pe = self.pe.unsqueeze(1) / self.d_model def forward(self, x): # make embeddings relatively larger # x = x * self.sqrt_d_model # add constant to embedding - addon = self.pe[:x.shape[0], :, :x.shape[2]].to(x.get_device()) - return x+addon + addon = self.pe[: x.shape[0], :, : x.shape[2]].to(x.get_device()) + return x + addon + class SimpleGATLayer(nn.Module): """The enhanced graph attention layer for heterogenenous neighborhood. @@ -80,7 +82,7 @@ def __init__(self, src_dim, dest_dim, edge_dim, hidden_size, nhead=4, position_e self.zero_padding_template = torch.zeros((1, src_dim), dtype=torch.float) - def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor=None): + def forward(self, src: Tensor, dest: Tensor, adj: Tensor, mask: Tensor, edges: Tensor=None): """Information aggregation from the source nodes to the destination nodes. Args: @@ -105,7 +107,7 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor """ assert(self.src_dim == src.shape[-1]) - assert(self.dest_dim== dest.shape[-1]) + assert(self.dest_dim == dest.shape[-1]) batch, s_cnt, src_dim = src.shape batch, d_cnt, dest_dim = dest.shape src_neighbor_cnt = adj.shape[0] @@ -120,8 +122,9 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor if edges is not None: src_embedding = torch.cat((src_embedding, edges), axis=2) - src_input = self.src_pre_layer(src_embedding.reshape(-1, src_dim+self.edge_dim)).reshape(*src_embedding.shape[:2], self.hidden_size) - dest_input = self.dest_pre_layer(dest.reshape(-1, dest_dim)).reshape(1, batch*d_cnt, self.hidden_size) + src_input = self.src_pre_layer(src_embedding.reshape(-1, src_dim + self.edge_dim)). \ + reshape(*src_embedding.shape[:2], self.hidden_size) + dest_input = self.dest_pre_layer(dest.reshape(-1, dest_dim)).reshape(1, batch * d_cnt, self.hidden_size) dest_emb, _ = self.att(dest_input, src_input, src_input, key_padding_mask=mask) dest_emb = dest_emb + self.att_dropout(dest_emb) @@ -129,7 +132,6 @@ def forward(self, src:Tensor, dest:Tensor, adj:Tensor, mask:Tensor, edges:Tensor return dest_emb.reshape(batch, d_cnt, self.hidden_size) - class SimpleTransformer(nn.Module): """Graph attention network with multiple graph in the CIM scenario. @@ -144,24 +146,26 @@ class SimpleTransformer(nn.Module): layer_num (int): The number of graph attention layers in each graph. """ - def __init__(self, p_dim, v_dim, edge_dim:dict, output_size, layer_num=2): + def __init__(self, p_dim, v_dim, edge_dim: dict, output_size, layer_num=2): super().__init__() self.hidden_size = output_size self.layer_num = layer_num pl, vl, ppl = [], [], [] for i in range(layer_num): - if i==0: + if i == 0: pl.append(SimpleGATLayer(v_dim, p_dim, edge_dim["v"], self.hidden_size, nhead=4)) vl.append(SimpleGATLayer(p_dim, v_dim, edge_dim["v"], self.hidden_size, nhead=4)) # p2p links - ppl.append(SimpleGATLayer(p_dim, p_dim, edge_dim["p"], self.hidden_size, nhead=4, position_encoding=False)) + ppl.append(SimpleGATLayer(p_dim, p_dim, edge_dim["p"], self.hidden_size, nhead=4, + position_encoding=False)) else: pl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) if i != layer_num - 1: # p2v conv is not necessary at the last layer, for we only use port features vl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) - ppl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, position_encoding=False)) + ppl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, + position_encoding=False)) self.p_layers = nn.ModuleList(pl) self.v_layers = nn.ModuleList(vl) self.pp_layers = nn.ModuleList(ppl) @@ -181,15 +185,17 @@ def forward(self, p, pe, v, ve, ppe): pre_p, pre_v, pre_pp = p, v, pp for i in range(self.layer_num): # only feed edge info in the first layer - p = self.p_layers[i](pre_v, pre_p, adj=pe["adj"], edges=pe["edge"] if i==0 else None, mask=pe["mask"]) + p = self.p_layers[i](pre_v, pre_p, adj=pe["adj"], edges=pe["edge"] if i == 0 else None, mask=pe["mask"]) if i != self.layer_num - 1: - v = self.v_layers[i](pre_p, pre_v, adj=ve["adj"], edges=ve["edge"] if i==0 else None, mask=ve["mask"]) + v = self.v_layers[i](pre_p, pre_v, adj=ve["adj"], edges=ve["edge"] if i == 0 else None, + mask=ve["mask"]) pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe["adj"], - edges=ppe["edge"] if i==0 else None, mask=ppe["mask"]) + edges=ppe["edge"] if i == 0 else None, mask=ppe["mask"]) pre_p, pre_v, pre_pp = p, v, pp p = torch.cat((p, pp), axis=2) return p, v + class GeLU(nn.Module): """Simple gelu wrapper as a independent module. """ def __init__(self): @@ -214,15 +220,14 @@ def __init__(self, input_size, hidden_size, output_size, net_type="res"): self.fc_0 = nn.Linear(input_size, hidden_size) self.act_0 = GeLU() # self.do_0 = Dropout(dropout) - self.fc_1 = nn.Linear(hidden_size, hidden_size//2) + self.fc_1 = nn.Linear(hidden_size, hidden_size // 2) self.act_1 = GeLU() - self.fc_2 = nn.Linear(hidden_size//2, output_size) + self.fc_2 = nn.Linear(hidden_size // 2, output_size) elif net_type == "1layer": self.fc_0 = nn.Linear(input_size, hidden_size) self.act_0 = GeLU() self.fc_1 = nn.Linear(hidden_size, output_size) - def forward(self, x): if self.net_type == "res": x1 = self.act_0(self.fc_0(x)) @@ -247,7 +252,8 @@ class SharedAC(nn.Module): as a critic layer, which are the two MLPs with residual connections. """ - def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, scale=4, ac_head="res"): + def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, + scale=4, ac_head="res"): super().__init__() assert(a or c) self.a, self.c = a, c @@ -255,21 +261,25 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer self.input_dim_p = input_dim_p self.tick_buffer = tick_buffer - self.pre_dim_v, self.pre_dim_p = 8*scale, 16*scale - self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) - self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) - p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation="gelu", dim_feedforward=self.pre_dim_p*4) - v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation="gelu", dim_feedforward=self.pre_dim_v*4) + self.pre_dim_v, self.pre_dim_p = 8 * scale, 16 * scale + self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), + PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) + self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), + PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) + p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation="gelu", + dim_feedforward=self.pre_dim_p * 4) + v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation="gelu", + dim_feedforward=self.pre_dim_v * 4) # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3) - self.gnn_output_size = 32*scale + self.gnn_output_size = 32 * scale self.trans_gat = SimpleTransformer( p_dim=self.pre_dim_p, v_dim=self.pre_dim_v, - output_size=self.gnn_output_size//2, + output_size=self.gnn_output_size // 2, edge_dim={"p": edge_dim_p, "v": edge_dim_v}, layer_num=2 ) @@ -277,15 +287,15 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer # self.reduce_dim = nn.Linear(self.a_input, 2) if a: - self.policy_hidden_size = 16*scale - self.a_input = 3*self.gnn_output_size//2 - self.actor = nn.Sequential(Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), nn.Softmax(dim=-1)) + self.policy_hidden_size = 16 * scale + self.a_input = 3 * self.gnn_output_size // 2 + self.actor = nn.Sequential(Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), + nn.Softmax(dim=-1)) if c: self.value_hidden_size = 16*scale self.c_input = self.gnn_output_size self.critic = Header(self.c_input, self.value_hidden_size, 1, ac_head) - def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): assert((a and p_idx is not None and v_idx is not None) or c) feature_p, feature_v = state["p"], state["v"] @@ -328,4 +338,3 @@ def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): if c and self.c: c_rtn = self.critic(emb_p).reshape(bsize, p_cnt) return a_rtn, c_rtn - diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index c08c940cb..119d29202 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -3,6 +3,7 @@ from maro.rl.shaping.state_shaper import StateShaper from examples.cim.gnn.utils import compute_v2p_degree_matrix + class GNNStateShaper(StateShaper): """State shaper to extract graph information. @@ -31,7 +32,7 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m # collect and encode ports and vessels together self.node_code_inv_dict_p = {i: i for i in self.port_code_list} - self.node_code_inv_dict_v = {i: i+self.port_cnt for i in self.vessel_code_list} + self.node_code_inv_dict_v = {i: i + self.port_cnt for i in self.vessel_code_list} self.node_cnt = self.port_cnt + self.vessel_cnt one_hot_coding = np.identity(self.node_cnt) @@ -56,17 +57,17 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m self._only_demo = only_demo self._feature_config = feature_config self._normalize = True - self._norm_scale = 2.0/max_value + self._norm_scale = 2.0 / max_value if not only_demo: self._state_dict = { # last "tick" is used for embedding, all zero and never be modified. - "v": np.zeros((self._max_tick+1, self.vessel_cnt, self.get_input_dim("v"))), - "p": np.zeros((self._max_tick+1, self.port_cnt, self.get_input_dim("p"))), - "vo": np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt), dtype=np.int), - "po": np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt), dtype=np.int), - "vedge": np.zeros((self._max_tick+1, self.vessel_cnt, self.port_cnt, self.get_input_dim("vedge"))), - "pedge": np.zeros((self._max_tick+1, self.port_cnt, self.vessel_cnt, self.get_input_dim("vedge"))), - "ppedge": np.zeros((self._max_tick+1, self.port_cnt, self.port_cnt, self.get_input_dim("pedge"))), + "v": np.zeros((self._max_tick + 1, self.vessel_cnt, self.get_input_dim("v"))), + "p": np.zeros((self._max_tick + 1, self.port_cnt, self.get_input_dim("p"))), + "vo": np.zeros((self._max_tick + 1, self.vessel_cnt, self.port_cnt), dtype=np.int), + "po": np.zeros((self._max_tick + 1, self.port_cnt, self.vessel_cnt), dtype=np.int), + "vedge": np.zeros((self._max_tick + 1, self.vessel_cnt, self.port_cnt, self.get_input_dim("vedge"))), + "pedge": np.zeros((self._max_tick + 1, self.port_cnt, self.vessel_cnt, self.get_input_dim("vedge"))), + "ppedge": np.zeros((self._max_tick + 1, self.port_cnt, self.port_cnt, self.get_input_dim("pedge"))), } # fixed order: in the order of degree @@ -74,7 +75,7 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m def compute_static_graph_structure(self, env): v2p_adj_matrix = compute_v2p_degree_matrix(env) p2p_adj_matrix = np.dot(v2p_adj_matrix.T, v2p_adj_matrix) - p2p_adj_matrix[p2p_adj_matrix==0] = self.max_arrival_time + p2p_adj_matrix[p2p_adj_matrix == 0] = self.max_arrival_time np.fill_diagonal(p2p_adj_matrix, self.max_arrival_time) self._p2p_embedding = self.sort(p2p_adj_matrix) @@ -124,8 +125,8 @@ def end_ep_callback(self, snapshot_list): tick_range = np.arange(start=self.last_tick, stop=self._max_tick) self._sync_raw_features(snapshot_list, list(tick_range)) - port_features = snapshot_list["ports"][list(range(self._max_tick)):self.port_code_list: self.port_features] \ - .reshape(self._max_tick, self.port_cnt, -1) + # port_features = snapshot_list["ports"][list(range(self._max_tick)):self.port_code_list: self.port_features] \ + # .reshape(self._max_tick, self.port_cnt, -1) # pkl.dump(port_features, open("/data/log/replay/snapshot.pkl", "wb")) self.last_tick = -1 @@ -162,15 +163,17 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) vessel_state_mat = self.normalize(vessel_naive_feature) if self._feature_config.onehot_identity: - vessel_state_mat = np.concatenate([vessel_state_mat, np.repeat(self.vessel_one_hot_coding, len(tick_range), axis=0)], axis=2) + vessel_state_mat = np.concatenate([vessel_state_mat, np.repeat(self.vessel_one_hot_coding, len(tick_range), + axis=0)], axis=2) self._state_dict["v"][tick_range] = vessel_state_mat # last_arrival_time.shape: vessel_cnt * port_cnt # -1 means one vessel never stops at the port - vessel_arrival_time = snapshot_list["matrices"][tick_range[-1]:: "vessel_plans"].reshape(self.vessel_cnt, self.port_cnt) + vessel_arrival_time = snapshot_list["matrices"][tick_range[-1]:: "vessel_plans"].reshape(self.vessel_cnt, + self.port_cnt) # use infinity time to identify vessels never arrive at the port last_arrival_time = vessel_arrival_time + 1 - last_arrival_time[last_arrival_time==0] = self.max_arrival_time + last_arrival_time[last_arrival_time == 0] = self.max_arrival_time if static_code is not None and dynamic_code is not None: # to differentiate vessel acting on the port and other vessels that have taken or wait to take actions. last_arrival_time[self.vessel_code_inv_dict[dynamic_code], self.port_code_inv_dict[static_code]] = 0 @@ -178,14 +181,13 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami # here, we assume that the order of arriving time between two action/event is all the same. vedge_raw = self.normalize(np.stack((full_on_vessel[-1], last_arrival_time), axis=-1)) vo, vedge = self.sort(last_arrival_time, attr=vedge_raw) - po, pedge = self.sort(last_arrival_time.T, attr=vedge_raw.transpose((1,0,2))) + po, pedge = self.sort(last_arrival_time.T, attr=vedge_raw.transpose((1, 0, 2))) self._state_dict["vo"][tick_range] = np.expand_dims(vo, axis=0) self._state_dict["vedge"][tick_range] = np.expand_dims(vedge, axis=0) self._state_dict["po"][tick_range] = np.expand_dims(po, axis=0) self._state_dict["pedge"][tick_range] = np.expand_dims(pedge, axis=0) self._state_dict["ppedge"][tick_range] = self.normalize(full_on_port[-1]).reshape(1, *full_on_port[-1].shape, 1) - def __call__(self, action_info=None, snapshot_list=None, tick=None): if self._only_demo: return @@ -198,14 +200,14 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): if self.last_tick == action_info.tick: tick_range = [action_info.tick] else: - tick_range = list(range(self.last_tick+1, action_info.tick+1, 1)) + tick_range = list(range(self.last_tick + 1, action_info.tick + 1, 1)) self.last_tick = action_info.tick self._sync_raw_features(snapshot_list, tick_range, static_code, dynamic_code) tick = action_info.tick # state_tick_range is inverse order. - state_tick_range = np.arange(tick, max(-1, tick-self._tick_buffer), -1) + state_tick_range = np.arange(tick, max(-1, tick - self._tick_buffer), -1) v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim("v"))) v[:len(state_tick_range)] = self._state_dict["v"][state_tick_range] p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim("p"))) @@ -232,7 +234,7 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): def normalize(self, feature): if not self._normalize: return feature - return feature*self._norm_scale + return feature * self._norm_scale def get_input_dim(self, agent_code): if agent_code in self.port_code_inv_dict or agent_code == "p": @@ -240,10 +242,10 @@ def get_input_dim(self, agent_code): elif agent_code in self.vessel_code_inv_dict or agent_code == "v": return len(self.vessel_features) + (self.node_cnt if self._feature_config.onehot_identity else 0) elif agent_code == "vedge": - # v-p edge: (arrival_time, laden to destination) + # v-p edge: (arrival_time, laden to destination) return 2 elif agent_code == "pedge": - # p-p edge: (laden to destination, ) + # p-p edge: (laden to destination, ) return 1 else: raise ValueError("agent not exist!") diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 84ba6239f..aaf5e719d 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -1,17 +1,22 @@ -import ast, math -import io, yaml, os, shutil +import ast +import io +import math import numpy as np import random +import os +import shutil import sys +import yaml from collections import defaultdict, OrderedDict import torch from torch.optim.lr_scheduler import LambdaLR from maro.simulator import Env -from maro.simulator.scenarios.cim.common import Action, DecisionEvent +from maro.simulator.scenarios.cim.common import Action from maro.utils import convert_dottable, clone + def compute_v2p_degree_matrix(env): """This function compute the adjacent matrix. """ topo_config = env.configs @@ -27,13 +32,17 @@ def compute_v2p_degree_matrix(env): return adj_matrix + def warm_up_lr(opt, warmup_steps): - warm_up = lambda ep: math.pow(warmup_steps, 0.5) * min(math.pow(ep+1, -0.5), math.pow(warmup_steps, -1.5)*(ep+1)) + warm_up = lambda ep: math.pow(warmup_steps, 0.5) * min(math.pow(ep + 1, -0.5), math.pow(warmup_steps, -1.5) * + (ep + 1)) return LambdaLR(opt, warm_up) + def from_numpy(device, *np_values): return [torch.from_numpy(v).to(device) for v in np_values] + def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): """Union multiple graph in CIM. @@ -102,10 +111,10 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): def flatten_embedding(embedding, batch_range, edge=None): if len(embedding.shape) == 3: batch, x_cnt, y_cnt = embedding.shape - addon = (batch_range*y_cnt).view(batch, 1, 1) + addon = (batch_range * y_cnt).view(batch, 1, 1) else: seq_len, batch, x_cnt, y_cnt = embedding.shape - addon = (batch_range*y_cnt).view(seq_len, batch, 1, 1) + addon = (batch_range * y_cnt).view(seq_len, batch, 1, 1) embedding_mask = embedding == 0 embedding += addon @@ -119,6 +128,7 @@ def flatten_embedding(embedding, batch_range, edge=None): edge = edge.reshape(-1, *edge.shape[2:])[:, col_mask, :] return ret, edge + def log2json(file_path): """load the log file as a json list. """ @@ -127,6 +137,7 @@ def log2json(file_path): json_list = "[" + ",".join(lines) + "]" return ast.literal_eval(json_list) + def decision_cnt_analysis(env, pv=False, buffer_size=8): if not pv: decision_cnt = [buffer_size] * len(env.node_name_mapping["static"]) @@ -148,8 +159,9 @@ def decision_cnt_analysis(env, pv=False, buffer_size=8): env.reset() return decision_cnt + def random_shortage(env, tick, action_dim=21): - zero_idx = action_dim//2 + zero_idx = action_dim // 2 r, pa, is_done = env.step(None) node_cnt = len(env.summary["node_mapping"]["ports"]) while not is_done: @@ -164,15 +176,16 @@ def random_shortage(env, tick, action_dim=21): action = Action(pa.vessel_idx, pa.port_idx, 0) r, pa, is_done = env.step(action) - shs = env.snapshot_list["ports"][tick-1:list(range(node_cnt)):"acc_shortage"] - fus = env.snapshot_list["ports"][tick-1:list(range(node_cnt)):"acc_fulfillment"] + shs = env.snapshot_list["ports"][tick - 1:list(range(node_cnt)):"acc_shortage"] + fus = env.snapshot_list["ports"][tick - 1:list(range(node_cnt)):"acc_fulfillment"] env.reset() return fus - shs, np.sum(shs+fus) + def return_scaler(env, tick, gamma, action_dim=21): R, tot_amount = random_shortage(env, tick, action_dim) - Rs_mean = np.mean(R)/tick/(1-gamma) - return abs(1.0/Rs_mean), tot_amount + Rs_mean = np.mean(R) / tick / (1-gamma) + return abs(1.0 / Rs_mean), tot_amount def load_config(config_pth): @@ -186,12 +199,14 @@ def load_config(config_pth): regularize_config(config) return config + def save_config(config, config_pth): with open(config_pth, "w") as fp: config = dottable2dict(config) - config["env"]["exp_per_ep"] = ["%d, %d, %d"%(k[0], k[1],d) for k, d in config["env"]["exp_per_ep"].items()] + config["env"]["exp_per_ep"] = ["%d, %d, %d" % (k[0], k[1], d) for k, d in config["env"]["exp_per_ep"].items()] yaml.safe_dump(config, fp) + def dottable2dict(config): if isinstance(config, float): return str(config) @@ -202,10 +217,11 @@ def dottable2dict(config): rt[k] = dottable2dict(v) return rt + def save_code(folder, save_pth): - save_path = os.path.join(save_pth,"code") - code_pth = os.path.join(os.getcwd(),folder) - shutil.copytree(code_pth,save_path) + save_path = os.path.join(save_pth, "code") + code_pth = os.path.join(os.getcwd(), folder) + shutil.copytree(code_pth, save_path) def fix_seed(env, seed): @@ -213,6 +229,7 @@ def fix_seed(env, seed): np.random.seed(seed) random.seed(seed) + def zero_play(**args): env = Env(**args) static_mapping = env.node_name_mapping["static"] @@ -245,18 +262,19 @@ def set_attr(config, attrs, value): set_attr(config[attrs[0]], attrs[1:], value) all_args = sys.argv[1:] - for i in range(len(all_args)//2): - name = all_args[i*2] + for i in range(len(all_args) // 2): + name = all_args[i * 2] attrs = name[2:].split(".") - value = parse_value(all_args[i*2+1]) + value = parse_value(all_args[i * 2 + 1]) set_attr(config, attrs, value) + def analysis_speed(env): speed_dict = defaultdict(int) eq_speed = 0 for ves in env.configs["vessels"].values(): speed_dict[ves["sailing"]["speed"]] += 1 for sp, cnt in speed_dict.items(): - eq_speed += 1.0*cnt/sp - eq_speed = 1.0/eq_speed + eq_speed += 1.0 * cnt / sp + eq_speed = 1.0 / eq_speed return speed_dict, eq_speed From 0fd4f5b1013ad1c402cc54c03b2744bbe55b5fff Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Thu, 15 Oct 2020 19:37:09 +0800 Subject: [PATCH 15/25] refine again --- examples/cim/gnn/action_shaper.py | 3 - examples/cim/gnn/actor.py | 49 ++++++++------- examples/cim/gnn/actor_critic.py | 30 ++++------ examples/cim/gnn/agent.py | 15 ++--- examples/cim/gnn/agent_manager.py | 86 +++++++++++++++++---------- examples/cim/gnn/experience_shaper.py | 3 +- examples/cim/gnn/launcher.py | 15 ++--- examples/cim/gnn/numpy_store.py | 6 +- examples/cim/gnn/simple_gnn.py | 56 +++++++++-------- examples/cim/gnn/state_shaper.py | 32 +++++----- examples/cim/gnn/utils.py | 28 ++++----- 11 files changed, 173 insertions(+), 150 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 435f21e82..65b9fedca 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -37,6 +37,3 @@ def __call__(self, decision_event, model_action): env_action = int(env_action) return env_action - - - diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index e4dd4d942..e5dff3c1f 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -70,6 +70,7 @@ def organize_exp_list(experience_collections: dict, idx_mapping: dict): tmpi += 1 return result + def organize_obs(obs, idx, exp_len): """Helper function to transform the observation from multiple processes to a unified dictionary. """ tick_buffer, _, para_cnt, v_cnt, v_dim = obs["v"].shape @@ -118,18 +119,19 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou list(env.summary["node_mapping"]["vessels"].values()) # create gnn_state_shaper without consuming any resources - gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, - config.model.feature, tick_buffer=config.model.tick_buffer, - max_value=env.configs["total_containers"]) + gnn_state_shaper = GNNStateShaper( + static_code_list, dynamic_code_list, config.env.param.durations, config.model.feature, + tick_buffer=config.model.tick_buffer, max_value=env.configs["total_containers"]) gnn_state_shaper.compute_static_graph_structure(env) action_io_np = action_io.structuralize() action_shaper = DiscreteActionShaper(config.model.action_dim) - exp_shaper = ExperienceShaper(static_code_list, dynamic_code_list, config.env.param.durations, gnn_state_shaper, - scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, - discount_factor=config.training.gamma, idx=index, - shared_storage=exp_output.structuralize(), exp_idx_mapping=exp_idx_mapping) + exp_shaper = ExperienceShaper( + static_code_list, dynamic_code_list, config.env.param.durations, gnn_state_shaper, + scale_factor=config.env.return_scaler, time_slot=config.training.td_steps, + discount_factor=config.training.gamma, idx=index, shared_storage=exp_output.structuralize(), + exp_idx_mapping=exp_idx_mapping) i = 0 while pipe.recv() == "reset": @@ -154,7 +156,8 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou model_action = pipe.recv() env_action = action_shaper(decision_event, model_action) exp_shaper.record(pending_action=decision_event, model_action=model_action, model_input=model_input) - logs.append([index, decision_event.tick, decision_event.port_idx, decision_event.vessel_idx, model_action, + logs.append([ + index, decision_event.tick, decision_event.port_idx, decision_event.vessel_idx, model_action, env_action, decision_event.action_scope.load, decision_event.action_scope.discharge]) action = Action(decision_event.vessel_idx, decision_event.port_idx, env_action) r, decision_event, is_done = env.step(action) @@ -205,10 +208,10 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self.device = torch.device(config.training.device) self.parallel_cnt = config.training.parallel_cnt - self.log_header = ["sh_%d"%i for i in range(self.parallel_cnt)] + self.log_header = ["sh_%d" % i for i in range(self.parallel_cnt)] tick_buffer = config.model.tick_buffer - action_dim = config.model.action_dim + # action_dim = config.model.action_dim v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim("v"), \ self._gnn_state_shaper.get_input_dim("vedge"), len(self._dynamic_node_mapping) @@ -271,9 +274,12 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self.exp_idx_mapping[key] = acc_c acc_c += c - self.workers = [Process( - target=single_player_worker, args=(i, config, self.exp_idx_mapping, self.pipes[i][1], - self.action_io, self.exp_output)) for i in range(self.parallel_cnt)] + self.workers = [ + Process( + target=single_player_worker, + args=(i, config, self.exp_idx_mapping, self.pipes[i][1], self.action_io, self.exp_output) + ) for i in range(self.parallel_cnt) + ] for w in self.workers: w.start() @@ -309,18 +315,21 @@ def roll_out(self): step_i += 1 t = time.time() - graph = gnn_union(self.action_io_np["p"], self.action_io_np["po"], self.action_io_np["pedge"], + graph = gnn_union( + self.action_io_np["p"], self.action_io_np["po"], self.action_io_np["pedge"], self.action_io_np["v"], self.action_io_np["vo"], self.action_io_np["vedge"], self._gnn_state_shaper.p2p_static_graph, self.action_io_np["ppedge"], - self.action_io_np["mask"], self.device) + self.action_io_np["mask"], self.device + ) t_state += time.time() - t assert(np.min(self.action_io_np["pid"]) == np.max(self.action_io_np["pid"])) assert(np.min(self.action_io_np["vid"]) == np.max(self.action_io_np["vid"])) t = time.time() - actions = self._inference_agents.choose_action(agent_id=(self.action_io_np["pid"][0], - self.action_io_np["vid"][0]), state=graph) + actions = self._inference_agents.choose_action( + agent_id=(self.action_io_np["pid"][0], self.action_io_np["vid"][0]), state=graph + ) t_action += time.time() - t for i, p in enumerate(self.pipes): @@ -336,14 +345,14 @@ def roll_out(self): self._logger.debug(dict(zip(self.log_header, self.action_io_np["sh"]))) - with open(os.path.join(self.config.log.path, "logs_%d"%self._roll_out_cnt), "wb") as fp: + with open(os.path.join(self.config.log.path, "logs_%d" % self._roll_out_cnt), "wb") as fp: pickle.dump(logs, fp) self._logger.info("organize exp_dict") result = organize_exp_list(self.exp_output_np, self.exp_idx_mapping) if self.config.log.exp.enable and self._roll_out_cnt % self.config.log.exp.freq == 0: - with open(os.path.join(self.config.log.path, "exp_%d"%self._roll_out_cnt), "wb") as fp: + with open(os.path.join(self.config.log.path, "exp_%d" % self._roll_out_cnt), "wb") as fp: pickle.dump(result, fp) self._logger.debug("play time: %d" % int(self._roll_out_time)) @@ -354,5 +363,3 @@ def exit(self): """Terminate the child processes. """ for p in self.pipes: p[0].send("close") - - diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index eee7030cb..790917c37 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -24,13 +24,9 @@ class ActorCritic(AbsAlgorithm): entropy_factor (float): The weight of the policy"s entropy to boost exploration. """ - def __init__(self, model: nn.Module, - device: torch.device, - p2p_adj=None, - td_steps=100, - gamma=0.97, - learning_rate=0.0003, - entropy_factor=0.1): + def __init__( + self, model: nn.Module, device: torch.device, p2p_adj=None, td_steps=100, gamma=0.97, learning_rate=0.0003, + entropy_factor=0.1): self._gamma = gamma self._td_steps = td_steps self._value_discount = gamma**100 @@ -38,9 +34,9 @@ def __init__(self, model: nn.Module, self._device = device self._tot_batchs = 0 self._p2p_adj = p2p_adj - super().__init__(model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, - loss_func_dict={}, - hyper_params=None) + super().__init__( + model_dict={"a&c": model}, optimizer_opt={"a&c": (torch.optim.Adam, {"lr": learning_rate})}, + loss_func_dict={}, hyper_params=None) def choose_action(self, state: dict, p_idx: int, v_idx: int): """Get action from the AC model. @@ -107,15 +103,15 @@ def train(self, batch, p_idx, v_idx): return_batch = batch["R"] next_obs_batch = batch["s_"] - obs_batch = gnn_union(obs_batch["p"], obs_batch["po"], obs_batch["pedge"], obs_batch["v"], - obs_batch["vo"], obs_batch["vedge"], self._p2p_adj, obs_batch["ppedge"], - obs_batch["mask"], self._device) + obs_batch = gnn_union( + obs_batch["p"], obs_batch["po"], obs_batch["pedge"], obs_batch["v"], obs_batch["vo"], obs_batch["vedge"], + self._p2p_adj, obs_batch["ppedge"], obs_batch["mask"], self._device) action_batch = torch.from_numpy(action_batch).long().to(self._device) return_batch = torch.from_numpy(return_batch).float().to(self._device) - next_obs_batch = gnn_union(next_obs_batch["p"], next_obs_batch["po"], next_obs_batch["pedge"], - next_obs_batch["v"], next_obs_batch["vo"], next_obs_batch["vedge"], - self._p2p_adj, next_obs_batch["ppedge"], next_obs_batch["mask"], - self._device) + next_obs_batch = gnn_union( + next_obs_batch["p"], next_obs_batch["po"], next_obs_batch["pedge"], next_obs_batch["v"], + next_obs_batch["vo"], next_obs_batch["vedge"], self._p2p_adj, next_obs_batch["ppedge"], + next_obs_batch["mask"], self._device) # train actor network # self._actor_optimizer.zero_grad() diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index c3899903d..cecdc2b3d 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -1,4 +1,3 @@ -import time from collections import defaultdict import numpy as np @@ -15,14 +14,14 @@ def __init__(self, name, algorithm, experience_pool, logger=DummyLogger()): def train(self, training_config): loss_dict = defaultdict(list) - loss_rt = defaultdict(float) + # loss_rt = defaultdict(float) # for code, exp_pool in experience_pool_dict.items(): for j in range(training_config.shuffle_time): shuffler = Shuffler(self._experience_pool, batch_size=training_config.batch_size) while shuffler.has_next(): batch = shuffler.next() - actor_loss, critic_loss, entropy_loss, tot_loss = self._algorithm.train(batch, self._name[0], - self._name[1]) + actor_loss, critic_loss, entropy_loss, tot_loss = self._algorithm.train( + batch, self._name[0], self._name[1]) loss_dict["actor"].append(actor_loss) loss_dict["critic"].append(critic_loss) loss_dict["entropy"].append(entropy_loss) @@ -32,11 +31,9 @@ def train(self, training_config): c_loss = np.mean(loss_dict["critic"]) e_loss = np.mean(loss_dict["entropy"]) tot_loss = np.mean(loss_dict["tot"]) - self._logger.debug("code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f"%(str(self._name), - float(a_loss), - float(c_loss), - float(e_loss), - float(tot_loss))) + self._logger.debug( + "code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f" % ( + str(self._name), float(a_loss), float(c_loss), float(e_loss), float(tot_loss))) self._experience_pool.clear() return loss_dict diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index b2e36e496..bff4ce19a 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -13,10 +13,12 @@ class SimpleAgentManger(AbsAgentManager): - def __init__(self, name, agent_id_list, ort_code_list, vessel_code_list, demo_env, state_shaper: GNNStateShaper, + def __init__( + self, name, agent_id_list, port_code_list, vessel_code_list, demo_env, state_shaper: GNNStateShaper, logger=DummyLogger()): - super().__init__(name, AgentMode.TRAIN, agent_id_list, state_shaper=state_shaper, action_shaper=None, - experience_shaper=None, explorer=None) + super().__init__( + name, AgentMode.TRAIN, agent_id_list, state_shaper=state_shaper, action_shaper=None, + experience_shaper=None, explorer=None) self.port_code_list = copy(port_code_list) self.vessel_code_list = copy(vessel_code_list) self.demo_env = demo_env @@ -24,41 +26,63 @@ def __init__(self, name, agent_id_list, ort_code_list, vessel_code_list, demo_en def assemble(self, config): v_dim, vedge_dim = self._state_shaper.get_input_dim("v"), self._state_shaper.get_input_dim("vedge") - p_dim, pedge_dim, p_cnt = self._state_shaper.get_input_dim("p"), self._state_shaper.get_input_dim("pedge"), - len(self.port_code_list) + p_dim, pedge_dim = self._state_shaper.get_input_dim("p"), self._state_shaper.get_input_dim("pedge") + # p_cnt = len(self.port_code_list) self.device = torch.device(config.training.device) self._logger.info(config.training.device) - ac_model = SharedAC(p_dim, pedge_dim, v_dim, vedge_dim, config.model.tick_buffer, config.model.action_dim). \ - to(self.device) + ac_model = SharedAC( + p_dim, pedge_dim, v_dim, vedge_dim, config.model.tick_buffer, config.model.action_dim).to(self.device) value_dict = { - ("s", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), - np.float32, False), - ("s", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), - np.float32, False), + ("s", "v"): + ( + (config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), + np.float32, False), + ("s", "p"): + ( + (config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), + np.float32, False), ("s", "vo"): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), ("s", "po"): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), - ("s", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), - self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), - self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), - self._state_shaper.get_input_dim("pedge")), np.float32, True), + ("s", "vedge"): + ( + (len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("vedge")), + np.float32, True), + ("s", "pedge"): + ( + (len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim("vedge")), + np.float32, True), + ("s", "ppedge"): + ( + (len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("pedge")), + np.float32, True), ("s", "mask"): ((config.model.tick_buffer, ), np.bool, True), - ("s_", "v"): ((config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), - np.float32, False), - ("s_", "p"): ((config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), - np.float32, False), + ("s_", "v"): + ( + (config.model.tick_buffer, len(self.vessel_code_list), self._state_shaper.get_input_dim("v")), + np.float32, False), + ("s_", "p"): + ( + (config.model.tick_buffer, len(self.port_code_list), self._state_shaper.get_input_dim("p")), + np.float32, False), ("s_", "vo"): ((len(self.vessel_code_list), len(self.port_code_list)), np.int64, True), - ("s_", "po"): ((len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), - ("s_", "vedge"): ((len(self.vessel_code_list), len(self.port_code_list), - self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s_", "pedge"): ((len(self.port_code_list), len(self.vessel_code_list), - self._state_shaper.get_input_dim("vedge")), np.float32, True), - ("s_", "ppedge"): ((len(self.port_code_list), len(self.port_code_list), - self._state_shaper.get_input_dim("pedge")), np.float32, True), + ("s_", "po"): + ( + (len(self.port_code_list), len(self.vessel_code_list)), np.int64, True), + ("s_", "vedge"): + ( + (len(self.vessel_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("vedge")), + np.float32, True), + ("s_", "pedge"): + ( + (len(self.port_code_list), len(self.vessel_code_list), self._state_shaper.get_input_dim("vedge")), + np.float32, True), + ("s_", "ppedge"): + ( + (len(self.port_code_list), len(self.port_code_list), self._state_shaper.get_input_dim("pedge")), + np.float32, True), ("s_", "mask"): ((config.model.tick_buffer, ), np.bool, True), # to identify one dimension variable @@ -66,9 +90,9 @@ def assemble(self, config): ("a",): (tuple(), np.int64, True), } - self._algorithm = ActorCritic(ac_model, self.device, td_steps=config.training.td_steps, - p2p_adj=self._state_shaper.p2p_static_graph, gamma=config.training.gamma, - learning_rate=config.training.learning_rate) + self._algorithm = ActorCritic( + ac_model, self.device, td_steps=config.training.td_steps, p2p_adj=self._state_shaper.p2p_static_graph, + gamma=config.training.gamma, learning_rate=config.training.learning_rate) for agent_id, cnt in config.env.exp_per_ep.items(): experience_pool = NumpyStore(value_dict, config.training.parallel_cnt * config.training.train_freq * cnt) diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index b06534c5f..fbb4015bd 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -4,7 +4,8 @@ class ExperienceShaper: - def __init__(self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, + def __init__( + self, static_list, dynamic_list, max_tick, gnn_state_shaper, scale_factor=0.0001, time_slot=100, discount_factor=0.97, idx=-1, shared_storage=None, exp_idx_mapping=None): self._static_list = list(static_list) self._dynamic_list = list(dynamic_list) diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 9ac472b94..ae4e8bd19 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -33,8 +33,8 @@ simulation_logger.info(config.env.exp_per_ep) # add some buffer to prevent overlapping - config.env.return_scaler, tot_order_amount = return_scaler(demo_env, tick=config.env.param.durations, - gamma=config.training.gamma) + config.env.return_scaler, tot_order_amount = return_scaler( + demo_env, tick=config.env.param.durations, gamma=config.training.gamma) simulation_logger.info("Return value will be scaled down by the factor %f" % config.env.return_scaler) save_config(config, os.path.join(config.log.path, "config.yml")) @@ -45,16 +45,17 @@ # create a mock gnn_state_shaper. static_code_list, dynamic_code_list = list(port_mapping.values()), list(vessel_mapping.values()) - gnn_state_shaper = GNNStateShaper(static_code_list, dynamic_code_list, config.env.param.durations, - config.model.feature, tick_buffer=config.model.tick_buffer, only_demo=True, - max_value=demo_env.configs["total_containers"]) + gnn_state_shaper = GNNStateShaper( + static_code_list, dynamic_code_list, config.env.param.durations, config.model.feature, + tick_buffer=config.model.tick_buffer, only_demo=True, max_value=demo_env.configs["total_containers"]) gnn_state_shaper.compute_static_graph_structure(demo_env) # create and assemble agent_manager agent_id_list = list(config.env.exp_per_ep.keys()) training_logger = Logger(tag="training", dump_folder=config.log.path, dump_mode="w", auto_timestamp=False) - agent_manager = SimpleAgentManger("CIM-GNN-manager", agent_id_list, static_code_list, dynamic_code_list, demo_env, - gnn_state_shaper, training_logger) + agent_manager = SimpleAgentManger( + "CIM-GNN-manager", agent_id_list, static_code_list, dynamic_code_list, demo_env, gnn_state_shaper, + training_logger) agent_manager.assemble(config) """ diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index b485d2918..c6a831a1e 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -71,8 +71,10 @@ def __init__(self, domain_type_dict, capacity): """ super().__init__() self.domain_type_dict = dict(domain_type_dict) - self.store = {key: np.zeros(shape=(capacity, *shape) if batch_first else (shape[0], capacity, *shape[1:]), - dtype=data_type) for key, (shape, data_type, batch_first) in domain_type_dict.items()} + self.store = { + key: np.zeros( + shape=(capacity, *shape) if batch_first else (shape[0], capacity, *shape[1:]), dtype=data_type) + for key, (shape, data_type, batch_first) in domain_type_dict.items()} self.batch_first_store = {key: batch_first for key, (_, _, batch_first) in domain_type_dict.items()} self.cnt = 0 diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 6ed90ce25..f9cb15930 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -82,7 +82,7 @@ def __init__(self, src_dim, dest_dim, edge_dim, hidden_size, nhead=4, position_e self.zero_padding_template = torch.zeros((1, src_dim), dtype=torch.float) - def forward(self, src: Tensor, dest: Tensor, adj: Tensor, mask: Tensor, edges: Tensor=None): + def forward(self, src: Tensor, dest: Tensor, adj: Tensor, mask: Tensor, edges: Tensor = None): """Information aggregation from the source nodes to the destination nodes. Args: @@ -122,8 +122,9 @@ def forward(self, src: Tensor, dest: Tensor, adj: Tensor, mask: Tensor, edges: T if edges is not None: src_embedding = torch.cat((src_embedding, edges), axis=2) - src_input = self.src_pre_layer(src_embedding.reshape(-1, src_dim + self.edge_dim)). \ - reshape(*src_embedding.shape[:2], self.hidden_size) + src_input = self.src_pre_layer( + src_embedding.reshape(-1, src_dim + self.edge_dim)). \ + reshape(*src_embedding.shape[:2], self.hidden_size) dest_input = self.dest_pre_layer(dest.reshape(-1, dest_dim)).reshape(1, batch * d_cnt, self.hidden_size) dest_emb, _ = self.att(dest_input, src_input, src_input, key_padding_mask=mask) @@ -157,15 +158,17 @@ def __init__(self, p_dim, v_dim, edge_dim: dict, output_size, layer_num=2): pl.append(SimpleGATLayer(v_dim, p_dim, edge_dim["v"], self.hidden_size, nhead=4)) vl.append(SimpleGATLayer(p_dim, v_dim, edge_dim["v"], self.hidden_size, nhead=4)) # p2p links - ppl.append(SimpleGATLayer(p_dim, p_dim, edge_dim["p"], self.hidden_size, nhead=4, - position_encoding=False)) + ppl.append( + SimpleGATLayer( + p_dim, p_dim, edge_dim["p"], self.hidden_size, nhead=4, position_encoding=False) + ) else: pl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) if i != layer_num - 1: # p2v conv is not necessary at the last layer, for we only use port features vl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) - ppl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, - position_encoding=False)) + ppl.append(SimpleGATLayer( + self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, position_encoding=False)) self.p_layers = nn.ModuleList(pl) self.v_layers = nn.ModuleList(vl) self.pp_layers = nn.ModuleList(ppl) @@ -187,10 +190,10 @@ def forward(self, p, pe, v, ve, ppe): # only feed edge info in the first layer p = self.p_layers[i](pre_v, pre_p, adj=pe["adj"], edges=pe["edge"] if i == 0 else None, mask=pe["mask"]) if i != self.layer_num - 1: - v = self.v_layers[i](pre_p, pre_v, adj=ve["adj"], edges=ve["edge"] if i == 0 else None, - mask=ve["mask"]) - pp = self.pp_layers[i](pre_pp, pre_pp, adj=ppe["adj"], - edges=ppe["edge"] if i == 0 else None, mask=ppe["mask"]) + v = self.v_layers[i]( + pre_p, pre_v, adj=ve["adj"], edges=ve["edge"] if i == 0 else None, mask=ve["mask"]) + pp = self.pp_layers[i]( + pre_pp, pre_pp, adj=ppe["adj"], edges=ppe["edge"] if i == 0 else None, mask=ppe["mask"]) pre_p, pre_v, pre_pp = p, v, pp p = torch.cat((p, pp), axis=2) return p, v @@ -252,8 +255,9 @@ class SharedAC(nn.Module): as a critic layer, which are the two MLPs with residual connections. """ - def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, - scale=4, ac_head="res"): + def __init__( + self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer, action_dim, a=True, c=True, + scale=4, ac_head="res"): super().__init__() assert(a or c) self.a, self.c = a, c @@ -262,14 +266,16 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer self.tick_buffer = tick_buffer self.pre_dim_v, self.pre_dim_p = 8 * scale, 16 * scale - self.p_pre_layer = nn.Sequential(nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), - PositionalEncoder(d_model=self.pre_dim_p, max_seq_len=tick_buffer)) - self.v_pre_layer = nn.Sequential(nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), - PositionalEncoder(d_model=self.pre_dim_v, max_seq_len=tick_buffer)) - p_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_p, nhead=4, activation="gelu", - dim_feedforward=self.pre_dim_p * 4) - v_encoder_layer = TransformerEncoderLayer(d_model=self.pre_dim_v, nhead=2, activation="gelu", - dim_feedforward=self.pre_dim_v * 4) + self.p_pre_layer = nn.Sequential( + nn.Linear(input_dim_p, self.pre_dim_p), GeLU(), PositionalEncoder( + d_model=self.pre_dim_p, max_seq_len=tick_buffer)) + self.v_pre_layer = nn.Sequential( + nn.Linear(input_dim_v, self.pre_dim_v), GeLU(), PositionalEncoder( + d_model=self.pre_dim_v, max_seq_len=tick_buffer)) + p_encoder_layer = TransformerEncoderLayer( + d_model=self.pre_dim_p, nhead=4, activation="gelu", dim_feedforward=self.pre_dim_p * 4) + v_encoder_layer = TransformerEncoderLayer( + d_model=self.pre_dim_v, nhead=2, activation="gelu", dim_feedforward=self.pre_dim_v * 4) # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) @@ -289,10 +295,10 @@ def __init__(self, input_dim_p, edge_dim_p, input_dim_v, edge_dim_v, tick_buffer if a: self.policy_hidden_size = 16 * scale self.a_input = 3 * self.gnn_output_size // 2 - self.actor = nn.Sequential(Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), - nn.Softmax(dim=-1)) + self.actor = nn.Sequential( + Header(self.a_input, self.policy_hidden_size, action_dim, ac_head), nn.Softmax(dim=-1)) if c: - self.value_hidden_size = 16*scale + self.value_hidden_size = 16 * scale self.c_input = self.gnn_output_size self.critic = Header(self.c_input, self.value_hidden_size, 1, ac_head) @@ -331,7 +337,7 @@ def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): if a and self.a: ap = emb_p.reshape(bsize, p_cnt, self.gnn_output_size) ap = ap[:, p_idx, :] - av = emb_v.reshape(bsize, v_cnt, self.gnn_output_size//2) + av = emb_v.reshape(bsize, v_cnt, self.gnn_output_size // 2) av = av[:, v_idx, :] emb_a = torch.cat((ap, av), axis=1) a_rtn = self.actor(emb_a) diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index 119d29202..980de2329 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -18,8 +18,9 @@ class GNNStateShaper(StateShaper): shaping(False). """ - def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, - tick_buffer=20, only_demo=False): + def __init__( + self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, tick_buffer=20, + only_demo=False): # collect and encode all ports self.port_code_list = list(port_code_list) self.port_cnt = len(self.port_code_list) @@ -40,10 +41,9 @@ def __init__(self, port_code_list, vessel_code_list, max_tick, feature_config, m self.vessel_one_hot_coding = np.expand_dims(one_hot_coding[self.port_cnt:], axis=0) self.last_tick = -1 - self.port_features = ["empty", "full", "capacity", - "on_shipper", - "on_consignee", "booking", "acc_booking", "shortage", "acc_shortage", - "fulfillment", "acc_fulfillment"] + self.port_features = [ + "empty", "full", "capacity", "on_shipper", "on_consignee", "booking", "acc_booking", "shortage", + "acc_shortage", "fulfillment", "acc_fulfillment"] self.vessel_features = ["empty", "full", "capacity", "remaining_space"] self._max_tick = max_tick @@ -138,10 +138,10 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami # one dim features. port_naive_feature = snapshot_list["ports"][tick_range: self.port_code_list: self.port_features] \ - .reshape(len(tick_range), self.port_cnt, -1) + .reshape(len(tick_range), self.port_cnt, -1) # number of laden from source to destination. - full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape(len(tick_range), self.port_cnt, - self.port_cnt) + full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape( + len(tick_range), self.port_cnt, self.port_cnt) # normalize features to a small range. # port_state_mat = self.normalize(np.concatenate([port_naive_feature, full_on_port], axis=2)) port_state_mat = self.normalize(port_naive_feature) @@ -156,21 +156,21 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami self._state_dict["p"][tick_range] = port_state_mat vessel_naive_feature = snapshot_list["vessels"][tick_range:self.vessel_code_list: self.vessel_features] \ - .reshape(len(tick_range), self.vessel_cnt, -1) - full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape(len(tick_range), - self.vessel_cnt, self.port_cnt) + .reshape(len(tick_range), self.vessel_cnt, -1) + full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape( + len(tick_range), self.vessel_cnt, self.port_cnt) # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) vessel_state_mat = self.normalize(vessel_naive_feature) if self._feature_config.onehot_identity: - vessel_state_mat = np.concatenate([vessel_state_mat, np.repeat(self.vessel_one_hot_coding, len(tick_range), - axis=0)], axis=2) + vessel_state_mat = np.concatenate( + [vessel_state_mat, np.repeat(self.vessel_one_hot_coding, len(tick_range), axis=0)], axis=2) self._state_dict["v"][tick_range] = vessel_state_mat # last_arrival_time.shape: vessel_cnt * port_cnt # -1 means one vessel never stops at the port - vessel_arrival_time = snapshot_list["matrices"][tick_range[-1]:: "vessel_plans"].reshape(self.vessel_cnt, - self.port_cnt) + vessel_arrival_time = snapshot_list["matrices"][tick_range[-1]:: "vessel_plans"].reshape( + self.vessel_cnt, self.port_cnt) # use infinity time to identify vessels never arrive at the port last_arrival_time = vessel_arrival_time + 1 last_arrival_time[last_arrival_time == 0] = self.max_arrival_time diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index aaf5e719d..ee38b7711 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -1,6 +1,5 @@ import ast import io -import math import numpy as np import random import os @@ -10,7 +9,6 @@ from collections import defaultdict, OrderedDict import torch -from torch.optim.lr_scheduler import LambdaLR from maro.simulator import Env from maro.simulator.scenarios.cim.common import Action @@ -33,12 +31,6 @@ def compute_v2p_degree_matrix(env): return adj_matrix -def warm_up_lr(opt, warmup_steps): - warm_up = lambda ep: math.pow(warmup_steps, 0.5) * min(math.pow(ep + 1, -0.5), math.pow(warmup_steps, -1.5) * - (ep + 1)) - return LambdaLR(opt, warm_up) - - def from_numpy(device, *np_values): return [torch.from_numpy(v).to(device) for v in np_values] @@ -57,8 +49,8 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): seq_len, batch, v_cnt, v_dim = v.shape _, _, p_cnt, p_dim = p.shape - p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask = from_numpy(device, p, po, pedge, - v, vo, vedge, p2p, ppedge, seq_mask) + p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask = from_numpy( + device, p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask) batch_range = torch.arange(batch, dtype=torch.long).to(device) # vadj.shape: (batch*v_cnt, p_cnt*) @@ -161,8 +153,8 @@ def decision_cnt_analysis(env, pv=False, buffer_size=8): def random_shortage(env, tick, action_dim=21): - zero_idx = action_dim // 2 - r, pa, is_done = env.step(None) + # zero_idx = action_dim // 2 + _, pa, is_done = env.step(None) node_cnt = len(env.summary["node_mapping"]["ports"]) while not is_done: """ @@ -179,12 +171,12 @@ def random_shortage(env, tick, action_dim=21): shs = env.snapshot_list["ports"][tick - 1:list(range(node_cnt)):"acc_shortage"] fus = env.snapshot_list["ports"][tick - 1:list(range(node_cnt)):"acc_fulfillment"] env.reset() - return fus - shs, np.sum(shs+fus) + return fus - shs, np.sum(shs + fus) def return_scaler(env, tick, gamma, action_dim=21): R, tot_amount = random_shortage(env, tick, action_dim) - Rs_mean = np.mean(R) / tick / (1-gamma) + Rs_mean = np.mean(R) / tick / (1 - gamma) return abs(1.0 / Rs_mean), tot_amount @@ -232,8 +224,8 @@ def fix_seed(env, seed): def zero_play(**args): env = Env(**args) - static_mapping = env.node_name_mapping["static"] - r, pa, is_done = env.step(None) + # static_mapping = env.node_name_mapping["static"] + _, pa, is_done = env.step(None) while not is_done: action = Action(pa.vessel_idx, pa.port_idx, 0) r, pa, is_done = env.step(action) @@ -244,10 +236,10 @@ def regularize_config(config): def parse_value(v): try: return int(v) - except: + except ValueError: try: return float(v) - except: + except ValueError: if v == "false" or v == "False": return False elif v == "true" or v == "True": From da6fa77fb6d31aa42c6d75739476ab94bfcd6bb5 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Fri, 16 Oct 2020 12:32:47 +0800 Subject: [PATCH 16/25] refine again --- examples/cim/gnn/action_shaper.py | 2 +- examples/cim/gnn/actor.py | 19 +++++++++---------- examples/cim/gnn/actor_critic.py | 4 ++-- examples/cim/gnn/agent.py | 4 ++-- examples/cim/gnn/config.yml | 4 ++-- examples/cim/gnn/launcher.py | 4 ++-- examples/cim/gnn/learner.py | 6 +++--- examples/cim/gnn/numpy_store.py | 2 +- examples/cim/gnn/simple_gnn.py | 2 +- examples/cim/gnn/state_shaper.py | 2 +- examples/cim/gnn/utils.py | 6 +++--- 11 files changed, 27 insertions(+), 28 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 65b9fedca..bd46dc3e3 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -2,7 +2,7 @@ class DiscreteActionShaper(ActionShaper): - """The shaping class to transform the action in [-1, 1] to actual repositioning function. """ + """The shaping class to transform the action in [-1, 1] to actual repositioning function.""" def __init__(self, action_dim): super().__init__() self._action_dim = action_dim diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index e5dff3c1f..74e2c7d17 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -72,7 +72,7 @@ def organize_exp_list(experience_collections: dict, idx_mapping: dict): def organize_obs(obs, idx, exp_len): - """Helper function to transform the observation from multiple processes to a unified dictionary. """ + """Helper function to transform the observation from multiple processes to a unified dictionary.""" tick_buffer, _, para_cnt, v_cnt, v_dim = obs["v"].shape _, _, _, p_cnt, p_dim = obs["p"].shape batch = exp_len * para_cnt @@ -174,8 +174,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou def compute_shortage(snapshot_list, max_tick, static_code_list): - """Helper function to compute the shortage after a episode end. - """ + """Helper function to compute the shortage after a episode end.""" return np.sum(snapshot_list["ports"][max_tick - 1: static_code_list: "acc_shortage"]) @@ -208,7 +207,7 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self.device = torch.device(config.training.device) self.parallel_cnt = config.training.parallel_cnt - self.log_header = ["sh_%d" % i for i in range(self.parallel_cnt)] + self.log_header = [f"sh_{i}" for i in range(self.parallel_cnt)] tick_buffer = config.model.tick_buffer # action_dim = config.model.action_dim @@ -340,26 +339,26 @@ def roll_out(self): self._logger.info("receiving exp") logs = [p[0].recv() for p in self.pipes] - self._logger.info("Mean of shortage: %f" % np.mean(self.action_io_np["sh"])) + self._logger.info(f"Mean of shortage: {np.mean(self.action_io_np["sh"])}") self._trainsfer_time += time.time() - tick self._logger.debug(dict(zip(self.log_header, self.action_io_np["sh"]))) - with open(os.path.join(self.config.log.path, "logs_%d" % self._roll_out_cnt), "wb") as fp: + with open(os.path.join(self.config.log.path, f"logs_{self._roll_out_cnt}"), "wb") as fp: pickle.dump(logs, fp) self._logger.info("organize exp_dict") result = organize_exp_list(self.exp_output_np, self.exp_idx_mapping) if self.config.log.exp.enable and self._roll_out_cnt % self.config.log.exp.freq == 0: - with open(os.path.join(self.config.log.path, "exp_%d" % self._roll_out_cnt), "wb") as fp: + with open(os.path.join(self.config.log.path, f"exp_{self._roll_out_cnt}"), "wb") as fp: pickle.dump(result, fp) - self._logger.debug("play time: %d" % int(self._roll_out_time)) - self._logger.debug("transfer time: %d" % int(self._trainsfer_time)) + self._logger.debug(f"play time: {int(self._roll_out_time)}") + self._logger.debug(f"transfer time: {int(self._trainsfer_time)}") return result def exit(self): - """Terminate the child processes. """ + """Terminate the child processes.""" for p in self.pipes: p[0].send("close") diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index 790917c37..b3b2b123b 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -165,7 +165,7 @@ def _get_save_idx(self, fp_str): def save_model(self, pth, id): if not os.path.exists(pth): os.makedirs(pth) - pth = os.path.join(pth, "%d_ac.pkl" % id) + pth = os.path.join(pth, f"{id}_ac.pkl") torch.save(self._model_dict["a&c"].state_dict(), pth) def _set_gnn_weights(self, weights): @@ -180,7 +180,7 @@ def load_model(self, folder_pth, idx=-1): fps.sort(key=self._get_save_idx) ac_pth = fps[-1] else: - ac_pth = "%d_ac.pkl" % idx + ac_pth = f"{idx}_ac.pkl" pth = os.path.join(folder_pth, ac_pth) with open(pth, "rb") as fp: weights = torch.load(fp, map_location=self._device) diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index cecdc2b3d..a4fcc81e8 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -32,8 +32,8 @@ def train(self, training_config): e_loss = np.mean(loss_dict["entropy"]) tot_loss = np.mean(loss_dict["tot"]) self._logger.debug( - "code: %s \t actor: %f \t critic: %f \t entropy: %f \t tot: %f" % ( - str(self._name), float(a_loss), float(c_loss), float(e_loss), float(tot_loss))) + f"code: {str(self._name)} \t actor: {float(a_loss)} \t critic: {float(c_loss)} \t entropy: {float(e_loss)} \ + \t tot: {float(tot_loss)}") self._experience_pool.clear() return loss_dict diff --git a/examples/cim/gnn/config.yml b/examples/cim/gnn/config.yml index 532fc8f0f..217b9b8a8 100644 --- a/examples/cim/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -3,8 +3,8 @@ env: param: durations: 750 scenario: "cim" - topology: "global_trade.22p_l0.1" - # topology: "toy.4p_ssdd_l0.0" + # topology: "global_trade.22p_l0.1" + topology: "toy.4p_ssdd_l0.0" training: enable: True parallel_cnt: 24 diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index ae4e8bd19..631351c97 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -17,7 +17,7 @@ # generate log path. date_str = datetime.datetime.now().strftime("%Y%m%d") time_str = datetime.datetime.now().strftime("%H%M%S.%f") - subfolder_name = "%s_%s" % (config.env.param.topology, time_str) + subfolder_name = f"{config.env.param.topology}_{time_str}" # log path. config.log.path = os.path.join(config.log.path, date_str, subfolder_name) @@ -35,7 +35,7 @@ # add some buffer to prevent overlapping config.env.return_scaler, tot_order_amount = return_scaler( demo_env, tick=config.env.param.durations, gamma=config.training.gamma) - simulation_logger.info("Return value will be scaled down by the factor %f" % config.env.return_scaler) + simulation_logger.info(f"Return value will be scaled down by the factor {config.env.return_scaler}") save_config(config, os.path.join(config.log.path, "config.yml")) save_code("examples/cim/gnn", config.log.path) diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index 28bd53514..88a6661dd 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -26,7 +26,7 @@ def train(self, training_config, log_pth=None): rollout_time = 0 training_time = 0 for i in range(training_config.rollout_cnt): - self._logger.info("rollout %d" % (i + 1)) + self._logger.info(f"rollout {i + 1}") tick = time.time() exp_dict = self._actor.roll_out() @@ -46,8 +46,8 @@ def train(self, training_config, log_pth=None): if log_pth is not None and (i + 1) % training_config.model_save_freq == 0: self._trainable_agents.save_model(os.path.join(log_pth, "models"), i + 1) - self._logger.debug("total rollout_time: %d" % int(rollout_time)) - self._logger.debug("train_time: %d" % int(training_time)) + self._logger.debug(f"total rollout_time: {int(rollout_time)}") + self._logger.debug(f"train_time: {int(training_time)}") def test(self): pass diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index c6a831a1e..50113305a 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -184,5 +184,5 @@ def next(self): return rst def has_next(self): - """Check if any experience is not visited. """ + """Check if any experience is not visited.""" return self._start < len(self._store) diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index f9cb15930..955de3083 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -200,7 +200,7 @@ def forward(self, p, pe, v, ve, ppe): class GeLU(nn.Module): - """Simple gelu wrapper as a independent module. """ + """Simple gelu wrapper as a independent module.""" def __init__(self): super().__init__() diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index 980de2329..12ae26195 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -131,7 +131,7 @@ def end_ep_callback(self, snapshot_list): self.last_tick = -1 def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): - """This function update the state_dict from snapshot_list in the given tick_range. """ + """This function update the state_dict from snapshot_list in the given tick_range.""" if len(tick_range) == 0: # this occurs when two actions happen at the same tick. return diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index ee38b7711..6ed40c081 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -16,7 +16,7 @@ def compute_v2p_degree_matrix(env): - """This function compute the adjacent matrix. """ + """This function compute the adjacent matrix.""" topo_config = env.configs static_dict = env.summary["node_mapping"]["ports"] dynamic_dict = env.summary["node_mapping"]["vessels"] @@ -122,7 +122,7 @@ def flatten_embedding(embedding, batch_range, edge=None): def log2json(file_path): - """load the log file as a json list. """ + """load the log file as a json list.""" with open(file_path, "r") as fp: lines = fp.read().splitlines() @@ -195,7 +195,7 @@ def load_config(config_pth): def save_config(config, config_pth): with open(config_pth, "w") as fp: config = dottable2dict(config) - config["env"]["exp_per_ep"] = ["%d, %d, %d" % (k[0], k[1], d) for k, d in config["env"]["exp_per_ep"].items()] + config["env"]["exp_per_ep"] = [f"{k[0]}, {k[1]}, {d}" for k, d in config["env"]["exp_per_ep"].items()] yaml.safe_dump(config, fp) From 40c8047af883c89f770cde43754cf7a5643cf3fa Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Fri, 16 Oct 2020 15:11:15 +0800 Subject: [PATCH 17/25] fix syntax bug --- examples/cim/gnn/actor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 74e2c7d17..5899f9c00 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -339,7 +339,7 @@ def roll_out(self): self._logger.info("receiving exp") logs = [p[0].recv() for p in self.pipes] - self._logger.info(f"Mean of shortage: {np.mean(self.action_io_np["sh"])}") + self._logger.info(f"Mean of shortage: {np.mean(self.action_io_np['sh'])}") self._trainsfer_time += time.time() - tick self._logger.debug(dict(zip(self.log_header, self.action_io_np["sh"]))) From c86d5d997ec641b0368038e970d083c21296801e Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Fri, 16 Oct 2020 19:21:34 +0800 Subject: [PATCH 18/25] refine again --- examples/cim/gnn/actor.py | 10 ++++---- examples/cim/gnn/actor_critic.py | 6 ++--- examples/cim/gnn/experience_shaper.py | 2 +- examples/cim/gnn/launcher.py | 10 ++++---- examples/cim/gnn/state_shaper.py | 36 +++++++++++++-------------- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 5899f9c00..649655469 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -10,10 +10,10 @@ import torch from examples.cim.gnn.action_shaper import DiscreteActionShaper -from examples.cim.gnn.utils import fix_seed, gnn_union from examples.cim.gnn.experience_shaper import ExperienceShaper from examples.cim.gnn.state_shaper import GNNStateShaper from examples.cim.gnn.shared_structure import SharedStructure +from examples.cim.gnn.utils import fix_seed, gnn_union from maro.rl import AbsActor from maro.simulator import Env from maro.simulator.scenarios.cim.common import Action @@ -117,7 +117,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou fix_seed(env, config.env.seed) static_code_list, dynamic_code_list = list(env.summary["node_mapping"]["ports"].values()), \ list(env.summary["node_mapping"]["vessels"].values()) - # create gnn_state_shaper without consuming any resources + # Create gnn_state_shaper without consuming any resources. gnn_state_shaper = GNNStateShaper( static_code_list, dynamic_code_list, config.env.param.durations, config.model.feature, @@ -166,7 +166,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou i += 1 pipe.send("done") gnn_state_shaper.end_ep_callback(env.snapshot_list) - # organize and synchronize exp to shared memory + # Organize and synchronize exp to shared memory. exp_shaper(env.snapshot_list) exp_shaper.reset() logs = np.array(logs, dtype=np.float) @@ -295,9 +295,9 @@ def roll_out(self): result (dict): The key is the agent code, the value is the experience list stored in numpy.array. """ - # compute the time used for state preparation in the child process. + # Compute the time used for state preparation in the child process. t_state = 0 - # compute the time used for action inference. + # Compute the time used for action inference. t_action = 0 for p in self.pipes: diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index b3b2b123b..c4f821ddf 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -113,12 +113,12 @@ def train(self, batch, p_idx, v_idx): next_obs_batch["vo"], next_obs_batch["vedge"], self._p2p_adj, next_obs_batch["ppedge"], next_obs_batch["mask"], self._device) - # train actor network + # Train actor network. # self._actor_optimizer.zero_grad() # self._critic_optimizer.zero_grad() self._optimizer["a&c"].zero_grad() - # every port has a value + # Every port has a value. # values.shape: (batch, p_cnt) probs, values = self._model_dict["a&c"](obs_batch, a=True, p_idx=p_idx, v_idx=v_idx, c=True) @@ -141,7 +141,7 @@ def train(self, batch, p_idx, v_idx): item_a_loss = actor_loss.item() item_e_loss = entropy_loss.mean().item() - # train critic network + # Train critic network. critic_loss = torch.sum(advantage.pow(2), axis=1).mean() # critic_loss.backward() item_c_loss = critic_loss.item() diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index fbb4015bd..d7f0905f7 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -30,7 +30,7 @@ def _init_state(self): self._last_tick = 0 def record(self, pending_action, model_action, model_input): - # only the experience that has the next state of given time slot is valuable + # Only the experience that has the next state of given time slot is valuable. if pending_action.tick + self._time_slot < self._max_tick: self._experience_dict[pending_action.port_idx, pending_action.vessel_idx].append({ "tick": pending_action.tick, diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 631351c97..14c359c6b 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -43,14 +43,14 @@ port_mapping = demo_env.summary["node_mapping"]["ports"] vessel_mapping = demo_env.summary["node_mapping"]["vessels"] - # create a mock gnn_state_shaper. + # Create a mock gnn_state_shaper. static_code_list, dynamic_code_list = list(port_mapping.values()), list(vessel_mapping.values()) gnn_state_shaper = GNNStateShaper( static_code_list, dynamic_code_list, config.env.param.durations, config.model.feature, tick_buffer=config.model.tick_buffer, only_demo=True, max_value=demo_env.configs["total_containers"]) gnn_state_shaper.compute_static_graph_structure(demo_env) - # create and assemble agent_manager + # Create and assemble agent_manager. agent_id_list = list(config.env.exp_per_ep.keys()) training_logger = Logger(tag="training", dump_folder=config.log.path, dump_mode="w", auto_timestamp=False) agent_manager = SimpleAgentManger( @@ -64,12 +64,12 @@ agent_manager.load_models_from(config.model.path) """ - # create the rollout actor to collect experience. + # Create the rollout actor to collect experience. actor = ParallelActor(config, demo_env, gnn_state_shaper, agent_manager, logger=simulation_logger) - # learner function for training and testing. + # Learner function for training and testing. learner = GNNLearner(actor, agent_manager, logger=simulation_logger) learner.train(config.training) - # cancel all the child process used for rollout. + # Cancel all the child process used for rollout. actor.exit() diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index 12ae26195..852e4e2d9 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -21,17 +21,17 @@ class GNNStateShaper(StateShaper): def __init__( self, port_code_list, vessel_code_list, max_tick, feature_config, max_value=100000, tick_buffer=20, only_demo=False): - # collect and encode all ports + # Collect and encode all ports. self.port_code_list = list(port_code_list) self.port_cnt = len(self.port_code_list) self.port_code_inv_dict = {code: i for i, code in enumerate(self.port_code_list)} - # collect and encode all vessels + # Collect and encode all vessels. self.vessel_code_list = list(vessel_code_list) self.vessel_cnt = len(self.vessel_code_list) self.vessel_code_inv_dict = {code: i for i, code in enumerate(self.vessel_code_list)} - # collect and encode ports and vessels together + # Collect and encode ports and vessels together. self.node_code_inv_dict_p = {i: i for i in self.port_code_list} self.node_code_inv_dict_v = {i: i + self.port_cnt for i in self.vessel_code_list} self.node_cnt = self.port_cnt + self.vessel_cnt @@ -48,7 +48,7 @@ def __init__( self._max_tick = max_tick self._tick_buffer = tick_buffer - # to identify one vessel would never arrive at the port + # To identify one vessel would never arrive at the port. self.max_arrival_time = 99999999 self.vedge_dim = 2 @@ -60,7 +60,7 @@ def __init__( self._norm_scale = 2.0 / max_value if not only_demo: self._state_dict = { - # last "tick" is used for embedding, all zero and never be modified. + # Last "tick" is used for embedding, all zero and never be modified. "v": np.zeros((self._max_tick + 1, self.vessel_cnt, self.get_input_dim("v"))), "p": np.zeros((self._max_tick + 1, self.port_cnt, self.get_input_dim("p"))), "vo": np.zeros((self._max_tick + 1, self.vessel_cnt, self.port_cnt), dtype=np.int), @@ -70,7 +70,7 @@ def __init__( "ppedge": np.zeros((self._max_tick + 1, self.port_cnt, self.port_cnt, self.get_input_dim("pedge"))), } - # fixed order: in the order of degree + # Fixed order: in the order of degree. def compute_static_graph_structure(self, env): v2p_adj_matrix = compute_v2p_degree_matrix(env) @@ -133,24 +133,24 @@ def end_ep_callback(self, snapshot_list): def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): """This function update the state_dict from snapshot_list in the given tick_range.""" if len(tick_range) == 0: - # this occurs when two actions happen at the same tick. + # This occurs when two actions happen at the same tick. return - # one dim features. + # One dim features. port_naive_feature = snapshot_list["ports"][tick_range: self.port_code_list: self.port_features] \ .reshape(len(tick_range), self.port_cnt, -1) - # number of laden from source to destination. + # Number of laden from source to destination. full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape( len(tick_range), self.port_cnt, self.port_cnt) - # normalize features to a small range. + # Normalize features to a small range. # port_state_mat = self.normalize(np.concatenate([port_naive_feature, full_on_port], axis=2)) port_state_mat = self.normalize(port_naive_feature) if self._feature_config.onehot_identity: - # add onehot vector to identify port and vessel. + # Add onehot vector to identify port and vessel. port_onehot = np.repeat(self.port_one_hot_coding, len(tick_range), axis=0) if static_code is not None and dynamic_code is not None: - # identify the decision vessel at the decision port. + # Identify the decision vessel at the decision port. port_onehot[-1, self.port_code_inv_dict[static_code], self.node_code_inv_dict_v[dynamic_code]] = -1 port_state_mat = np.concatenate([port_state_mat, port_onehot], axis=2) self._state_dict["p"][tick_range] = port_state_mat @@ -171,14 +171,14 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami # -1 means one vessel never stops at the port vessel_arrival_time = snapshot_list["matrices"][tick_range[-1]:: "vessel_plans"].reshape( self.vessel_cnt, self.port_cnt) - # use infinity time to identify vessels never arrive at the port + # Use infinity time to identify vessels never arrive at the port. last_arrival_time = vessel_arrival_time + 1 last_arrival_time[last_arrival_time == 0] = self.max_arrival_time if static_code is not None and dynamic_code is not None: - # to differentiate vessel acting on the port and other vessels that have taken or wait to take actions. + # To differentiate vessel acting on the port and other vessels that have taken or wait to take actions. last_arrival_time[self.vessel_code_inv_dict[dynamic_code], self.port_code_inv_dict[static_code]] = 0 - # here, we assume that the order of arriving time between two action/event is all the same. + # Here, we assume that the order of arriving time between two action/event is all the same. vedge_raw = self.normalize(np.stack((full_on_vessel[-1], last_arrival_time), axis=-1)) vo, vedge = self.sort(last_arrival_time, attr=vedge_raw) po, pedge = self.sort(last_arrival_time.T, attr=vedge_raw.transpose((1, 0, 2))) @@ -194,7 +194,7 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): assert((action_info is not None and snapshot_list is not None) or tick is not None) if action_info is not None and snapshot_list is not None: - # update the state dict. + # Update the state dict. static_code = action_info.port_idx dynamic_code = action_info.vessel_idx if self.last_tick == action_info.tick: @@ -206,14 +206,14 @@ def __call__(self, action_info=None, snapshot_list=None, tick=None): self._sync_raw_features(snapshot_list, tick_range, static_code, dynamic_code) tick = action_info.tick - # state_tick_range is inverse order. + # State_tick_range is inverse order. state_tick_range = np.arange(tick, max(-1, tick - self._tick_buffer), -1) v = np.zeros((self._tick_buffer, self.vessel_cnt, self.get_input_dim("v"))) v[:len(state_tick_range)] = self._state_dict["v"][state_tick_range] p = np.zeros((self._tick_buffer, self.port_cnt, self.get_input_dim("p"))) p[:len(state_tick_range)] = self._state_dict["p"][state_tick_range] - # true means padding. + # True means padding. mask = np.ones(self._tick_buffer, dtype=np.bool) mask[:len(state_tick_range)] = False ret = { From ba84802a3e34e83b84800d448e0465e6cbbf2e28 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Fri, 16 Oct 2020 19:36:56 +0800 Subject: [PATCH 19/25] remove useless comments --- examples/cim/gnn/action_shaper.py | 2 -- examples/cim/gnn/actor.py | 1 - examples/cim/gnn/actor_critic.py | 9 ++------- examples/cim/gnn/agent.py | 2 -- examples/cim/gnn/agent_manager.py | 3 +-- examples/cim/gnn/config.yml | 2 -- examples/cim/gnn/experience_shaper.py | 10 +--------- examples/cim/gnn/launcher.py | 8 ++++---- examples/cim/gnn/learner.py | 4 ---- examples/cim/gnn/simple_gnn.py | 25 +++++++------------------ examples/cim/gnn/utils.py | 4 ---- 11 files changed, 15 insertions(+), 55 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index bd46dc3e3..562f91e48 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -19,9 +19,7 @@ def __call__(self, decision_event, model_action): pending_action (Event): The decision event from the environment. model_action (int): Output action, range A means the half of the agent output dim. """ - # tick = pending_action.tick env_action = 0 - # action_index = model_action model_action -= self._zero_action action_scope = decision_event.action_scope diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 649655469..cd7956d4e 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -210,7 +210,6 @@ def __init__(self, config, demo_env, gnn_state_shaper, agent_manager, logger): self.log_header = [f"sh_{i}" for i in range(self.parallel_cnt)] tick_buffer = config.model.tick_buffer - # action_dim = config.model.action_dim v_dim, vedge_dim, v_cnt = self._gnn_state_shaper.get_input_dim("v"), \ self._gnn_state_shaper.get_input_dim("vedge"), len(self._dynamic_node_mapping) diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index c4f821ddf..d42523eb7 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -114,13 +114,10 @@ def train(self, batch, p_idx, v_idx): next_obs_batch["mask"], self._device) # Train actor network. - # self._actor_optimizer.zero_grad() - # self._critic_optimizer.zero_grad() self._optimizer["a&c"].zero_grad() # Every port has a value. # values.shape: (batch, p_cnt) - probs, values = self._model_dict["a&c"](obs_batch, a=True, p_idx=p_idx, v_idx=v_idx, c=True) distribution = Categorical(probs) log_prob = distribution.log_prob(action_batch) @@ -135,9 +132,6 @@ def train(self, batch, p_idx, v_idx): actor_loss = - (log_prob * torch.sum(advantage, axis=-1).detach()).mean() - # actor_loss.backward(retain_graph=True) - # self._actor_optimizer["a&c"].step() - item_a_loss = actor_loss.item() item_e_loss = entropy_loss.mean().item() @@ -147,7 +141,8 @@ def train(self, batch, p_idx, v_idx): item_c_loss = critic_loss.item() # torch.nn.utils.clip_grad_norm_(self._critic_model.parameters(),0.5) # self._critic_optimizer["a&c"].step() - tot_loss = 0.1 * actor_loss + critic_loss # - self._entropy_factor * entropy_loss + # - self._entropy_factor * entropy_loss + tot_loss = 0.1 * actor_loss + critic_loss tot_loss.backward() tot_norm = clip_grad.clip_grad_norm_(self._model_dict["a&c"].parameters(), 1) self._optimizer["a&c"].step() diff --git a/examples/cim/gnn/agent.py b/examples/cim/gnn/agent.py index a4fcc81e8..a99171e72 100644 --- a/examples/cim/gnn/agent.py +++ b/examples/cim/gnn/agent.py @@ -14,8 +14,6 @@ def __init__(self, name, algorithm, experience_pool, logger=DummyLogger()): def train(self, training_config): loss_dict = defaultdict(list) - # loss_rt = defaultdict(float) - # for code, exp_pool in experience_pool_dict.items(): for j in range(training_config.shuffle_time): shuffler = Shuffler(self._experience_pool, batch_size=training_config.batch_size) while shuffler.has_next(): diff --git a/examples/cim/gnn/agent_manager.py b/examples/cim/gnn/agent_manager.py index bff4ce19a..e51dc704d 100644 --- a/examples/cim/gnn/agent_manager.py +++ b/examples/cim/gnn/agent_manager.py @@ -27,7 +27,6 @@ def __init__( def assemble(self, config): v_dim, vedge_dim = self._state_shaper.get_input_dim("v"), self._state_shaper.get_input_dim("vedge") p_dim, pedge_dim = self._state_shaper.get_input_dim("p"), self._state_shaper.get_input_dim("pedge") - # p_cnt = len(self.port_code_list) self.device = torch.device(config.training.device) self._logger.info(config.training.device) @@ -85,7 +84,7 @@ def assemble(self, config): np.float32, True), ("s_", "mask"): ((config.model.tick_buffer, ), np.bool, True), - # to identify one dimension variable + # To identify one dimension variable. ("R",): ((len(self.port_code_list), ), np.float32, True), ("a",): (tuple(), np.int64, True), } diff --git a/examples/cim/gnn/config.yml b/examples/cim/gnn/config.yml index 217b9b8a8..7f332292a 100644 --- a/examples/cim/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -31,8 +31,6 @@ model: onehot_identity: False log: path: "./" - # be careful to turn this on - snapshot: True exp: enable: false freq: 10 diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index d7f0905f7..3cb0bd1f1 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -57,15 +57,11 @@ def __call__(self, snapshot_list): shortage = snapshot_list["ports"][self._tick_range:self._static_list:"shortage"].reshape(self._max_tick, -1) fulfillment = snapshot_list["ports"][self._tick_range:self._static_list:"fulfillment"] \ .reshape(self._max_tick, -1) - # tot_shortage = np.sum(shortage, axis=1) - # tot_fulfillment = np.sum(fulfillment, axis=1) delta = fulfillment - shortage R = np.empty((self._len_return, len(self._static_list)), dtype=np.float) for i in range(0, self._len_return, 1): R[i] = np.dot(self._discount_vector, delta[i + 1: i + self._time_slot + 1]) - # pkl.dump(R, open(r"/data/log/replay/R2.pkl", "wb")) - for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): for exp in exp_list: tick = exp["tick"] @@ -74,10 +70,9 @@ def __call__(self, snapshot_list): tmpi = 0 for (agent_idx, vessel_idx), idx_base in self._exp_idx_mapping.items(): - # for (agent_idx, vessel_idx), exp_list in self._experience_dict.items(): exp_list = self._experience_dict[(agent_idx, vessel_idx)] exp_len = len(exp_list) - # here, we assume that exp_idx_mapping order is not changed. + # Here, we assume that exp_idx_mapping order is not changed. self._shared_storage["len"][self._idx, tmpi] = exp_len self._shared_storage["s"]["v"][:, idx_base:idx_base + exp_len, self._idx] = \ np.stack([e["s"]["v"] for e in exp_list], axis=1) @@ -111,9 +106,6 @@ def __call__(self, snapshot_list): np.vstack([exp["R"] for exp in exp_list]) tmpi += 1 - # pkl.dump(self._exp_idx_mapping, open(r"/data/log/replay/order2.pkl", "wb")) - # pkl.dump(self._shared_storage, open(r"/data/log/replay/22p2.pkl", "wb")) - def reset(self): del self._experience_dict self._init_state() diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 14c359c6b..604b0992a 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -14,25 +14,25 @@ config_pth = "examples/cim/gnn/config.yml" config = load_config(config_pth) - # generate log path. + # Generate log path. date_str = datetime.datetime.now().strftime("%Y%m%d") time_str = datetime.datetime.now().strftime("%H%M%S.%f") subfolder_name = f"{config.env.param.topology}_{time_str}" - # log path. + # Log path. config.log.path = os.path.join(config.log.path, date_str, subfolder_name) if not os.path.exists(config.log.path): os.makedirs(config.log.path) simulation_logger = Logger(tag="simulation", dump_folder=config.log.path, dump_mode="w", auto_timestamp=False) - # create a demo environment to retrieve environment information. + # Create a demo environment to retrieve environment information. simulation_logger.info("Approximating the experience quantity of each agent...") demo_env = Env(**config.env.param) config.env.exp_per_ep = decision_cnt_analysis(demo_env, pv=True, buffer_size=8) simulation_logger.info(config.env.exp_per_ep) - # add some buffer to prevent overlapping + # Add some buffer to prevent overlapping. config.env.return_scaler, tot_order_amount = return_scaler( demo_env, tick=config.env.param.durations, gamma=config.training.gamma) simulation_logger.info(f"Return value will be scaled down by the factor {config.env.return_scaler}") diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index 88a6661dd..da55e3681 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -37,10 +37,6 @@ def train(self, training_config, log_pth=None): if training_config.enable and i % training_config.train_freq == training_config.train_freq - 1: tick = time.time() - - # for code, exp_pool in experience_pool_dict.items(): - # loss_dict = self._trainable_agents.train(training_config) - training_time += time.time() - tick if log_pth is not None and (i + 1) % training_config.model_save_freq == 0: diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 955de3083..1105eda36 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -23,8 +23,7 @@ def __init__(self, d_model, max_seq_len=80): self.d_model = d_model self.times = 4 * math.sqrt(self.d_model) - # create constant "pe" matrix with values dependant on - # pos and i + # Create constant "pe" matrix with values dependant on pos and i. self.pe = torch.zeros(max_seq_len, d_model) for pos in range(max_seq_len): for i in range(0, d_model, 2): @@ -34,9 +33,7 @@ def __init__(self, d_model, max_seq_len=80): self.pe = self.pe.unsqueeze(1) / self.d_model def forward(self, x): - # make embeddings relatively larger - # x = x * self.sqrt_d_model - # add constant to embedding + # Make embeddings relatively larger. addon = self.pe[: x.shape[0], :, : x.shape[2]].to(x.get_device()) return x + addon @@ -115,9 +112,7 @@ def forward(self, src: Tensor, dest: Tensor, adj: Tensor, mask: Tensor, edges: T src_embedding = src.reshape(-1, src_dim) src_embedding = torch.cat((self.zero_padding_template.to(src_embedding.get_device()), src_embedding)) - # adj = adj[:,torch.randperm(adj.size()[1])] flat_adj = adj.reshape(-1) - # src_cnt * (batch * dest_cnt) * src_dim src_embedding = src_embedding[flat_adj].reshape(src_neighbor_cnt, -1, src_dim) if edges is not None: src_embedding = torch.cat((src_embedding, edges), axis=2) @@ -157,7 +152,7 @@ def __init__(self, p_dim, v_dim, edge_dim: dict, output_size, layer_num=2): if i == 0: pl.append(SimpleGATLayer(v_dim, p_dim, edge_dim["v"], self.hidden_size, nhead=4)) vl.append(SimpleGATLayer(p_dim, v_dim, edge_dim["v"], self.hidden_size, nhead=4)) - # p2p links + # p2p links. ppl.append( SimpleGATLayer( p_dim, p_dim, edge_dim["p"], self.hidden_size, nhead=4, position_encoding=False) @@ -165,7 +160,7 @@ def __init__(self, p_dim, v_dim, edge_dim: dict, output_size, layer_num=2): else: pl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) if i != layer_num - 1: - # p2v conv is not necessary at the last layer, for we only use port features + # p2v conv is not necessary at the last layer, for we only use port features. vl.append(SimpleGATLayer(self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4)) ppl.append(SimpleGATLayer( self.hidden_size, self.hidden_size, 0, self.hidden_size, nhead=4, position_encoding=False)) @@ -187,7 +182,7 @@ def forward(self, p, pe, v, ve, ppe): pp = p pre_p, pre_v, pre_pp = p, v, pp for i in range(self.layer_num): - # only feed edge info in the first layer + # Only feed edge info in the first layer. p = self.p_layers[i](pre_v, pre_p, adj=pe["adj"], edges=pe["edge"] if i == 0 else None, mask=pe["mask"]) if i != self.layer_num - 1: v = self.v_layers[i]( @@ -310,8 +305,8 @@ def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): v_cnt = feature_v.shape[2] assert(tb == self.tick_buffer) - # before: feature_p.shape: (tick_buffer, batch_size, p_cnt, p_dim) - # after: feature_p.shape: (tick_buffer, batch_size*p_cnt, p_dim) + # Before: feature_p.shape: (tick_buffer, batch_size, p_cnt, p_dim) + # After: feature_p.shape: (tick_buffer, batch_size*p_cnt, p_dim) feature_p = self.p_pre_layer(feature_p.reshape(feature_p.shape[0], -1, feature_p.shape[-1])) # state["mask"]: (batch_size, tick_buffer) # mask_p: (batch_size, p_cnt, tick_buffer) @@ -327,12 +322,6 @@ def forward(self, state, a=False, p_idx=None, v_idx=None, c=False): emb_p, emb_v = self.trans_gat(feature_p, state["pe"], feature_v, state["ve"], state["ppe"]) - # date_str = f"{datetime.datetime.now().strftime("%Y%m%d")}" - # time_str = f"{datetime.datetime.now().strftime("%H%M%S.%f")}" - # subfolder_name = "%s_%s"%("./visualization/graph_embedding_p.npy", time_str) - # np.save("%s_%s.npy"%("./visualization/emb/p_emb/emb", time_str), emb_p.cpu().detach().numpy()) - # np.save("%s_%s.npy"%("./visualization/emb/v_emb/emb", time_str), emb_v.cpu().detach().numpy()) - a_rtn, c_rtn = None, None if a and self.a: ap = emb_p.reshape(bsize, p_cnt, self.gnn_output_size) diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 6ed40c081..4e8de14b0 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -61,13 +61,11 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): vadj = vadj.transpose(0, 1) # vedge.shape: (p_cnt*, batch*v_cnt, e_dim) vedge = vedge.transpose(0, 1) - # vedge = vedge.reshape(-1, *vedge.shape[-2:]).transpose(0, 1)[:vadj.shape[0]] padj, pedge = flatten_embedding(po, batch_range, pedge) pmask = padj == 0 padj = padj.transpose(0, 1) pedge = pedge.transpose(0, 1) - # pedge = pedge.reshape(-1, *pedge.shape[-2:]).transpose(0, 1)[:padj.shape[0]] p2p_adj = p2p.repeat(batch, 1, 1) # p2p_adj.shape: (batch*p_cnt, p_cnt*) @@ -153,7 +151,6 @@ def decision_cnt_analysis(env, pv=False, buffer_size=8): def random_shortage(env, tick, action_dim=21): - # zero_idx = action_dim // 2 _, pa, is_done = env.step(None) node_cnt = len(env.summary["node_mapping"]["ports"]) while not is_done: @@ -224,7 +221,6 @@ def fix_seed(env, seed): def zero_play(**args): env = Env(**args) - # static_mapping = env.node_name_mapping["static"] _, pa, is_done = env.step(None) while not is_done: action = Action(pa.vessel_idx, pa.port_idx, 0) From 255ed679dc2c6935e873a7ce8816a62ac55ba761 Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Fri, 16 Oct 2020 19:53:21 +0800 Subject: [PATCH 20/25] remove unnecessary blank line --- examples/cim/gnn/actor.py | 1 - examples/cim/gnn/numpy_store.py | 9 +++------ examples/cim/gnn/state_shaper.py | 11 ----------- examples/cim/gnn/utils.py | 2 -- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index cd7956d4e..155b44a76 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -293,7 +293,6 @@ def roll_out(self): Returns: result (dict): The key is the agent code, the value is the experience list stored in numpy.array. """ - # Compute the time used for state preparation in the child process. t_state = 0 # Compute the time used for action inference. diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index 50113305a..2cd746b03 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -27,8 +27,7 @@ def get_item(data_dict, key_tuple): def set_item(data_dict, key_tuple, data): - """The setter function corresponding to the get_item function. - """ + """The setter function corresponding to the get_item function.""" for i, key in enumerate(key_tuple): if key not in data_dict: data_dict[key] = {} @@ -101,7 +100,6 @@ def put(self, exp_dict: dict): Returns: indexes (numpy.array): The list of the indexes each experience in the batch is located in. """ - dlen = exp_dict["len"] append_end = min(max(self.capacity - self.cnt, 0), dlen) idxs = np.zeros(dlen, dtype=np.int) @@ -155,8 +153,7 @@ def sample(self, size, weights: Sequence, replace: bool = True): raise NotImplementedError("NumpyStore does not support sampling. Please use outer sampler to fetch samples!") def clear(self): - """Remove all the experience in the store. - """ + """Remove all the experience in the store.""" self.cnt = 0 @@ -175,7 +172,7 @@ def __init__(self, store: NumpyStore, batch_size: int): self._batch_size = batch_size def next(self): - """Uniformly sampling out a batch in the store. """ + """Uniformly sampling out a batch in the store.""" if self._start >= len(self._store): return None end = min(self._start + self._batch_size, len(self._store)) diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index 852e4e2d9..aebf2d432 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -108,17 +108,6 @@ def sort(self, arrival_time, attr=None): else: return at_index, attr - """ - def arg_idx(self, arrival_time, p_or_v): - if self._feature_config.attention_order == "temporal": - return self.sort(arrival_time) - elif self._feature_config.attention_order == "meta_path_cnt": - return self._fixed_p_order if p_or_v else self._fixed_v_order - else: - # randomize the arrival time - return self.sort(arrival_time + np.random.randint(self._max_tick, size=arrival_time.shape)) - """ - def end_ep_callback(self, snapshot_list): if self._only_demo: return diff --git a/examples/cim/gnn/utils.py b/examples/cim/gnn/utils.py index 4e8de14b0..4c23c10aa 100644 --- a/examples/cim/gnn/utils.py +++ b/examples/cim/gnn/utils.py @@ -45,7 +45,6 @@ def gnn_union(p, po, pedge, v, vo, vedge, p2p, ppedge, seq_mask, device): Returns: result (dict): The dictionary that describes the graph. """ - seq_len, batch, v_cnt, v_dim = v.shape _, _, p_cnt, p_dim = p.shape @@ -121,7 +120,6 @@ def flatten_embedding(embedding, batch_range, edge=None): def log2json(file_path): """load the log file as a json list.""" - with open(file_path, "r") as fp: lines = fp.read().splitlines() json_list = "[" + ",".join(lines) + "]" From c8861948efbc3f286d9645ea4c17fd376f77bddf Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Fri, 16 Oct 2020 20:02:06 +0800 Subject: [PATCH 21/25] rename pending_event to decision_event --- examples/cim/gnn/action_shaper.py | 2 +- examples/cim/gnn/actor.py | 2 +- examples/cim/gnn/experience_shaper.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/cim/gnn/action_shaper.py b/examples/cim/gnn/action_shaper.py index 562f91e48..9daf20eef 100644 --- a/examples/cim/gnn/action_shaper.py +++ b/examples/cim/gnn/action_shaper.py @@ -16,7 +16,7 @@ def __call__(self, decision_event, model_action): upper bound and lower bound of actual action are the resource in dynamic and static node respectively. Args: - pending_action (Event): The decision event from the environment. + decision_event (Event): The decision event from the environment. model_action (int): Output action, range A means the half of the agent output dim. """ env_action = 0 diff --git a/examples/cim/gnn/actor.py b/examples/cim/gnn/actor.py index 155b44a76..4c9215d8c 100644 --- a/examples/cim/gnn/actor.py +++ b/examples/cim/gnn/actor.py @@ -155,7 +155,7 @@ def single_player_worker(index, config, exp_idx_mapping, pipe, action_io, exp_ou pipe.send("features") model_action = pipe.recv() env_action = action_shaper(decision_event, model_action) - exp_shaper.record(pending_action=decision_event, model_action=model_action, model_input=model_input) + exp_shaper.record(decision_event=decision_event, model_action=model_action, model_input=model_input) logs.append([ index, decision_event.tick, decision_event.port_idx, decision_event.vessel_idx, model_action, env_action, decision_event.action_scope.load, decision_event.action_scope.discharge]) diff --git a/examples/cim/gnn/experience_shaper.py b/examples/cim/gnn/experience_shaper.py index 3cb0bd1f1..1bc6f6352 100644 --- a/examples/cim/gnn/experience_shaper.py +++ b/examples/cim/gnn/experience_shaper.py @@ -29,11 +29,11 @@ def _init_state(self): self._experience_dict = defaultdict(list) self._last_tick = 0 - def record(self, pending_action, model_action, model_input): + def record(self, decision_event, model_action, model_input): # Only the experience that has the next state of given time slot is valuable. - if pending_action.tick + self._time_slot < self._max_tick: - self._experience_dict[pending_action.port_idx, pending_action.vessel_idx].append({ - "tick": pending_action.tick, + if decision_event.tick + self._time_slot < self._max_tick: + self._experience_dict[decision_event.port_idx, decision_event.vessel_idx].append({ + "tick": decision_event.tick, "s": model_input, "a": model_action, }) From 669da1a9a497dbaf27bf06dfe5106cf311c5a58d Mon Sep 17 00:00:00 2001 From: wenshi-113 Date: Sat, 17 Oct 2020 12:29:23 +0800 Subject: [PATCH 22/25] remove some code faced to the future. --- examples/cim/gnn/actor_critic.py | 3 --- examples/cim/gnn/launcher.py | 6 ------ examples/cim/gnn/numpy_store.py | 4 ++-- examples/cim/gnn/shared_structure.py | 18 +++++++++++------- examples/cim/gnn/simple_gnn.py | 4 ++-- examples/cim/gnn/state_shaper.py | 6 ------ 6 files changed, 15 insertions(+), 26 deletions(-) diff --git a/examples/cim/gnn/actor_critic.py b/examples/cim/gnn/actor_critic.py index d42523eb7..53c10be82 100644 --- a/examples/cim/gnn/actor_critic.py +++ b/examples/cim/gnn/actor_critic.py @@ -137,11 +137,8 @@ def train(self, batch, p_idx, v_idx): # Train critic network. critic_loss = torch.sum(advantage.pow(2), axis=1).mean() - # critic_loss.backward() item_c_loss = critic_loss.item() # torch.nn.utils.clip_grad_norm_(self._critic_model.parameters(),0.5) - # self._critic_optimizer["a&c"].step() - # - self._entropy_factor * entropy_loss tot_loss = 0.1 * actor_loss + critic_loss tot_loss.backward() tot_norm = clip_grad.clip_grad_norm_(self._model_dict["a&c"].parameters(), 1) diff --git a/examples/cim/gnn/launcher.py b/examples/cim/gnn/launcher.py index 604b0992a..6714e976f 100644 --- a/examples/cim/gnn/launcher.py +++ b/examples/cim/gnn/launcher.py @@ -58,12 +58,6 @@ training_logger) agent_manager.assemble(config) - """ - # currently not support loading model - if os.path.exists(config.model.path): - agent_manager.load_models_from(config.model.path) - """ - # Create the rollout actor to collect experience. actor = ParallelActor(config, demo_env, gnn_state_shaper, agent_manager, logger=simulation_logger) diff --git a/examples/cim/gnn/numpy_store.py b/examples/cim/gnn/numpy_store.py index 2cd746b03..c8d8e6d3b 100644 --- a/examples/cim/gnn/numpy_store.py +++ b/examples/cim/gnn/numpy_store.py @@ -80,7 +80,7 @@ def __init__(self, domain_type_dict, capacity): self.capacity = capacity def put(self, exp_dict: dict): - """Insert a batch of experience into the store + """Insert a batch of experience into the store. If the store reaches the maximum capacity, this function will replace the experience in the store randomly. @@ -127,7 +127,7 @@ def _get_replace_idx(self, cnt): return np.random.randint(low=0, high=self.capacity, size=cnt) def get(self, indexes: np.array): - """Get the experience indexed in the indexes list from the store + """Get the experience indexed in the indexes list from the store. Args: indexes (np.array): A numpy array containing the indexes of a batch experience. diff --git a/examples/cim/gnn/shared_structure.py b/examples/cim/gnn/shared_structure.py index 296a4d420..b79a44370 100644 --- a/examples/cim/gnn/shared_structure.py +++ b/examples/cim/gnn/shared_structure.py @@ -4,13 +4,17 @@ def init_shared_memory(data_structure): - # data_structure should be a dict like: - # { - # "a": (shape, type), - # "b": { - # "b1": (shape, type), - # } - # } + """Initialize the data structure of the shared memory. + + Args: + data_structure: The dictionary that describes the data structure. For example, + { + "a": (shape, type), + "b": { + "b1": (shape, type), + } + } + """ if isinstance(data_structure, tuple): mult = 1 for i in data_structure[0]: diff --git a/examples/cim/gnn/simple_gnn.py b/examples/cim/gnn/simple_gnn.py index 1105eda36..61d5eefb6 100644 --- a/examples/cim/gnn/simple_gnn.py +++ b/examples/cim/gnn/simple_gnn.py @@ -271,6 +271,8 @@ def __init__( d_model=self.pre_dim_p, nhead=4, activation="gelu", dim_feedforward=self.pre_dim_p * 4) v_encoder_layer = TransformerEncoderLayer( d_model=self.pre_dim_v, nhead=2, activation="gelu", dim_feedforward=self.pre_dim_v * 4) + + # Alternative initialization: define the normalization. # self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_p)) # self.trans_layer_v = TransformerEncoder(v_encoder_layer, num_layers=3, norm=Norm(self.pre_dim_v)) self.trans_layer_p = TransformerEncoder(p_encoder_layer, num_layers=3) @@ -285,8 +287,6 @@ def __init__( layer_num=2 ) - # self.reduce_dim = nn.Linear(self.a_input, 2) - if a: self.policy_hidden_size = 16 * scale self.a_input = 3 * self.gnn_output_size // 2 diff --git a/examples/cim/gnn/state_shaper.py b/examples/cim/gnn/state_shaper.py index aebf2d432..cf360a178 100644 --- a/examples/cim/gnn/state_shaper.py +++ b/examples/cim/gnn/state_shaper.py @@ -113,10 +113,6 @@ def end_ep_callback(self, snapshot_list): return tick_range = np.arange(start=self.last_tick, stop=self._max_tick) self._sync_raw_features(snapshot_list, list(tick_range)) - - # port_features = snapshot_list["ports"][list(range(self._max_tick)):self.port_code_list: self.port_features] \ - # .reshape(self._max_tick, self.port_cnt, -1) - # pkl.dump(port_features, open("/data/log/replay/snapshot.pkl", "wb")) self.last_tick = -1 def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynamic_code=None): @@ -132,7 +128,6 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami full_on_port = snapshot_list["matrices"][tick_range::"full_on_ports"].reshape( len(tick_range), self.port_cnt, self.port_cnt) # Normalize features to a small range. - # port_state_mat = self.normalize(np.concatenate([port_naive_feature, full_on_port], axis=2)) port_state_mat = self.normalize(port_naive_feature) if self._feature_config.onehot_identity: @@ -149,7 +144,6 @@ def _sync_raw_features(self, snapshot_list, tick_range, static_code=None, dynami full_on_vessel = snapshot_list["matrices"][tick_range::"full_on_vessels"].reshape( len(tick_range), self.vessel_cnt, self.port_cnt) - # vessel_state_mat = self.normalize(np.concatenate([vessel_naive_feature, full_on_vessel], axis=2)) vessel_state_mat = self.normalize(vessel_naive_feature) if self._feature_config.onehot_identity: vessel_state_mat = np.concatenate( From b2074830641a6588e2da2f64ad3aea712b79bf4b Mon Sep 17 00:00:00 2001 From: wesley stone Date: Thu, 22 Oct 2020 18:38:57 +0800 Subject: [PATCH 23/25] change topology --- .../cim/topologies/config_auto_generator.py | 6 +- .../global_trade.22p_l0.0/config.yml | 96 +-- .../global_trade.22p_l0.1/config.yml | 96 +-- .../global_trade.22p_l0.2/config.yml | 96 +-- .../global_trade.22p_l0.3/config.yml | 316 ++++---- .../global_trade.22p_l0.4/config.yml | 674 ++++++++-------- .../global_trade.22p_l0.5/config.yml | 674 ++++++++-------- .../global_trade.22p_l0.6/config.yml | 718 +++++++++--------- .../global_trade.22p_l0.7/config.yml | 718 +++++++++--------- .../global_trade.22p_l0.8/config.yml | 718 +++++++++--------- 10 files changed, 2056 insertions(+), 2056 deletions(-) diff --git a/maro/simulator/scenarios/cim/topologies/config_auto_generator.py b/maro/simulator/scenarios/cim/topologies/config_auto_generator.py index 86fb4e705..d1e95aaf6 100644 --- a/maro/simulator/scenarios/cim/topologies/config_auto_generator.py +++ b/maro/simulator/scenarios/cim/topologies/config_auto_generator.py @@ -6,11 +6,11 @@ import shutil import random -TOPOLOGY_LIST = ["toy.4p_ssdd", "toy.5p_ssddd", "toy.6p_sssbdd", "global_trade.22p"] +TOPOLOGY_LIST = ["global_trade.22p"] SAILING_TIME = 7 -VESSEL_CAPACITY_REDUNDANCY_RATIOS = [20, 1.5, 1.5, 1.5, 1.5, 1.5, 2.0, 2.5, 2.5] +VESSEL_CAPACITY_REDUNDANCY_RATIOS = [20, 4.5, 4.5, 4.5, 4.5, 4.5, 6.0, 6.0, 6.0] VESSEL_CAPACITY_DELTA_RATIO = 0.1 -AVG_ORDER_RATIO = 0.02 +AVG_ORDER_RATIO = 0.008 ORDER_RATIO_DELTA = 0.005 ORDER_NOISE = 0.002 PERIOD = 112 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml index 33495fbc2..43fe45f37 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml @@ -2,9 +2,9 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.01 + - 0.008 - - 111 - - 0.01 + - 0.008 sample_noise: 0 container_volumes: - 1 @@ -949,7 +949,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 3869 + capacity: 3095 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 3869 + capacity: 3095 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 2189 + capacity: 1751 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 2189 + capacity: 1751 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 23034 + capacity: 18427 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 23034 + capacity: 18427 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 4591 + capacity: 3673 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 4591 + capacity: 3673 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 5664 + capacity: 4531 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 5664 + capacity: 4531 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 26415 + capacity: 21132 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 26415 + capacity: 21132 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 26415 + capacity: 21132 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 26415 + capacity: 21132 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 26415 + capacity: 21132 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 26415 + capacity: 21132 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 19690 + capacity: 15752 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 19690 + capacity: 15752 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 19690 + capacity: 15752 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 9775 + capacity: 7820 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 9775 + capacity: 7820 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 9775 + capacity: 7820 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 8519 + capacity: 6815 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 8519 + capacity: 6815 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 8519 + capacity: 6815 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 3589 + capacity: 2871 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 3589 + capacity: 2871 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 3589 + capacity: 2871 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 3589 + capacity: 2871 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 3589 + capacity: 2871 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 2588 + capacity: 2070 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 2588 + capacity: 2070 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 2588 + capacity: 2070 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 2588 + capacity: 2070 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 4740 + capacity: 3792 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 4740 + capacity: 3792 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 4740 + capacity: 3792 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 4740 + capacity: 3792 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 4740 + capacity: 3792 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 4740 + capacity: 3792 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 25330 + capacity: 20264 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 25330 + capacity: 20264 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 25330 + capacity: 20264 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 25330 + capacity: 20264 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 25330 + capacity: 20264 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 25330 + capacity: 20264 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml index 15a5bce0a..9ecce7b5a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml @@ -2,9 +2,9 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.01 + - 0.008 - - 111 - - 0.01 + - 0.008 sample_noise: 0 container_volumes: - 1 @@ -949,7 +949,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml index 15a5bce0a..9ecce7b5a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml @@ -2,9 +2,9 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.01 + - 0.008 - - 111 - - 0.01 + - 0.008 sample_noise: 0 container_volumes: - 1 @@ -949,7 +949,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml index 87ce885ce..8b808a4f1 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml @@ -2,229 +2,229 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.005 + - 0.003 - - 1 - - 0.005007865924910917 + - 0.003007865924910917 - - 2 - - 0.005031438950533787 + - 0.003031438950533787 - - 3 - - 0.005070644907408821 + - 0.003070644907408821 - - 4 - - 0.005125360439090882 + - 0.0031253604390908823 - - 5 - - 0.005195413390274502 + - 0.003195413390274502 - - 6 - - 0.005280583348458163 + - 0.0032805833484581626 - - 7 - - 0.005380602337443566 + - 0.003380602337443566 - - 8 - - 0.005495155660487905 + - 0.0034951556604879046 - - 9 - - 0.0056238828904562315 + - 0.0036238828904562315 - - 10 - - 0.0057663790038585796 + - 0.0037663790038585795 - - 11 - - 0.005922195655203699 + - 0.003922195655203699 - - 12 - - 0.006090842587659851 + - 0.004090842587659851 - - 13 - - 0.006271789175584172 + - 0.004271789175584172 - - 14 - - 0.006464466094067262 + - 0.004464466094067262 - - 15 - - 0.006668267110239981 + - 0.004668267110239981 - - 16 - - 0.006882550990706332 + - 0.004882550990706332 - - 17 - - 0.007106643519100972 + - 0.0051066435191009715 - - 18 - - 0.007339839617423317 + - 0.005339839617423317 - - 19 - - 0.007581405564473801 + - 0.005581405564473801 - - 20 - - 0.007830581304412209 + - 0.005830581304412209 - - 21 - - 0.00808658283817455 + - 0.006086582838174551 - - 22 - - 0.008348604690224165 + - 0.006348604690224164 - - 23 - - 0.008615822442875754 + - 0.006615822442875753 - - 24 - - 0.008887395330218428 + - 0.006887395330218428 - - 25 - - 0.009162468883476318 + - 0.007162468883476318 - - 26 - - 0.00944017761948346 + - 0.00744017761948346 - - 27 - - 0.009719647763814041 + - 0.007719647763814041 - - 28 - - 0.01 + - 0.008 - - 29 - - 0.01028035223618596 + - 0.00828035223618596 - - 30 - - 0.010559822380516538 + - 0.00855982238051654 - - 31 - - 0.010837531116523682 + - 0.008837531116523682 - - 32 - - 0.011112604669781572 + - 0.009112604669781572 - - 33 - - 0.011384177557124247 + - 0.009384177557124247 - - 34 - - 0.011651395309775834 + - 0.009651395309775834 - - 35 - - 0.011913417161825448 + - 0.00991341716182545 - - 36 - - 0.01216941869558779 + - 0.01016941869558779 - - 37 - - 0.0124185944355262 + - 0.010418594435526198 - - 38 - - 0.012660160382576682 + - 0.010660160382576682 - - 39 - - 0.012893356480899029 + - 0.010893356480899029 - - 40 - - 0.013117449009293668 + - 0.011117449009293668 - - 41 - - 0.01333173288976002 + - 0.01133173288976002 - - 42 - - 0.013535533905932737 + - 0.011535533905932737 - - 43 - - 0.013728210824415828 + - 0.011728210824415828 - - 44 - - 0.01390915741234015 + - 0.011909157412340148 - - 45 - - 0.014077804344796302 + - 0.0120778043447963 - - 46 - - 0.014233620996141422 + - 0.01223362099614142 - - 47 - - 0.014376117109543769 + - 0.012376117109543769 - - 48 - - 0.014504844339512095 + - 0.012504844339512097 - - 49 - - 0.014619397662556434 + - 0.012619397662556434 - - 50 - - 0.014719416651541837 + - 0.012719416651541839 - - 51 - - 0.014804586609725497 + - 0.012804586609725499 - - 52 - - 0.014874639560909118 + - 0.012874639560909118 - - 53 - - 0.01492935509259118 + - 0.01292935509259118 - - 54 - - 0.014968561049466214 + - 0.012968561049466212 - - 55 - - 0.014992134075089083 + - 0.012992134075089083 - - 56 - - 0.015 + - 0.013000000000000001 - - 57 - - 0.014992134075089083 + - 0.012992134075089083 - - 58 - - 0.014968561049466212 + - 0.012968561049466212 - - 59 - - 0.01492935509259118 + - 0.01292935509259118 - - 60 - - 0.014874639560909118 + - 0.012874639560909118 - - 61 - - 0.014804586609725499 + - 0.012804586609725499 - - 62 - - 0.014719416651541837 + - 0.012719416651541839 - - 63 - - 0.014619397662556434 + - 0.012619397662556434 - - 64 - - 0.014504844339512095 + - 0.012504844339512097 - - 65 - - 0.014376117109543767 + - 0.012376117109543769 - - 66 - - 0.014233620996141422 + - 0.012233620996141422 - - 67 - - 0.014077804344796302 + - 0.012077804344796302 - - 68 - - 0.01390915741234015 + - 0.011909157412340152 - - 69 - - 0.013728210824415828 + - 0.011728210824415828 - - 70 - - 0.01353553390593274 + - 0.01153553390593274 - - 71 - - 0.01333173288976002 + - 0.01133173288976002 - - 72 - - 0.01311744900929367 + - 0.011117449009293668 - - 73 - - 0.012893356480899027 + - 0.010893356480899029 - - 74 - - 0.012660160382576684 + - 0.010660160382576684 - - 75 - - 0.012418594435526202 + - 0.010418594435526202 - - 76 - - 0.012169418695587792 + - 0.010169418695587792 - - 77 - - 0.011913417161825451 + - 0.009913417161825451 - - 78 - - 0.011651395309775837 + - 0.009651395309775837 - - 79 - - 0.011384177557124247 + - 0.009384177557124247 - - 80 - - 0.011112604669781574 + - 0.009112604669781574 - - 81 - - 0.010837531116523686 + - 0.008837531116523686 - - 82 - - 0.01055982238051654 + - 0.00855982238051654 - - 83 - - 0.010280352236185957 + - 0.008280352236185957 - - 84 - - 0.010000000000000002 + - 0.008000000000000002 - - 85 - - 0.009719647763814045 + - 0.007719647763814045 - - 86 - - 0.009440177619483462 + - 0.007440177619483462 - - 87 - - 0.009162468883476316 + - 0.007162468883476316 - - 88 - - 0.008887395330218428 + - 0.006887395330218429 - - 89 - - 0.008615822442875756 + - 0.006615822442875756 - - 90 - - 0.008348604690224165 + - 0.006348604690224166 - - 91 - - 0.00808658283817455 + - 0.00608658283817455 - - 92 - - 0.00783058130441221 + - 0.00583058130441221 - - 93 - - 0.0075814055644738 + - 0.0055814055644738 - - 94 - - 0.007339839617423318 + - 0.005339839617423318 - - 95 - - 0.007106643519100974 + - 0.005106643519100974 - - 96 - - 0.006882550990706333 + - 0.004882550990706333 - - 97 - - 0.006668267110239979 + - 0.004668267110239979 - - 98 - - 0.006464466094067263 + - 0.004464466094067263 - - 99 - - 0.006271789175584174 + - 0.004271789175584174 - - 100 - - 0.006090842587659851 + - 0.004090842587659851 - - 101 - - 0.0059221956552036985 + - 0.0039221956552036984 - - 102 - - 0.00576637900385858 + - 0.0037663790038585804 - - 103 - - 0.005623882890456233 + - 0.003623882890456233 - - 104 - - 0.005495155660487905 + - 0.0034951556604879046 - - 105 - - 0.005380602337443568 + - 0.003380602337443568 - - 106 - - 0.005280583348458163 + - 0.0032805833484581626 - - 107 - - 0.005195413390274502 + - 0.003195413390274502 - - 108 - - 0.005125360439090882 + - 0.0031253604390908823 - - 109 - - 0.005070644907408821 + - 0.003070644907408821 - - 110 - - 0.005031438950533787 + - 0.003031438950533787 - - 111 - - 0.005007865924910917 + - 0.003007865924910917 sample_noise: 0 container_volumes: - 1 @@ -1169,7 +1169,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml index 2661dac99..6a571ab80 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml @@ -2,229 +2,229 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.005 + - 0.003 - - 1 - - 0.005007865924910917 + - 0.003007865924910917 - - 2 - - 0.005031438950533787 + - 0.003031438950533787 - - 3 - - 0.005070644907408821 + - 0.003070644907408821 - - 4 - - 0.005125360439090882 + - 0.0031253604390908823 - - 5 - - 0.005195413390274502 + - 0.003195413390274502 - - 6 - - 0.005280583348458163 + - 0.0032805833484581626 - - 7 - - 0.005380602337443566 + - 0.003380602337443566 - - 8 - - 0.005495155660487905 + - 0.0034951556604879046 - - 9 - - 0.0056238828904562315 + - 0.0036238828904562315 - - 10 - - 0.0057663790038585796 + - 0.0037663790038585795 - - 11 - - 0.005922195655203699 + - 0.003922195655203699 - - 12 - - 0.006090842587659851 + - 0.004090842587659851 - - 13 - - 0.006271789175584172 + - 0.004271789175584172 - - 14 - - 0.006464466094067262 + - 0.004464466094067262 - - 15 - - 0.006668267110239981 + - 0.004668267110239981 - - 16 - - 0.006882550990706332 + - 0.004882550990706332 - - 17 - - 0.007106643519100972 + - 0.0051066435191009715 - - 18 - - 0.007339839617423317 + - 0.005339839617423317 - - 19 - - 0.007581405564473801 + - 0.005581405564473801 - - 20 - - 0.007830581304412209 + - 0.005830581304412209 - - 21 - - 0.00808658283817455 + - 0.006086582838174551 - - 22 - - 0.008348604690224165 + - 0.006348604690224164 - - 23 - - 0.008615822442875754 + - 0.006615822442875753 - - 24 - - 0.008887395330218428 + - 0.006887395330218428 - - 25 - - 0.009162468883476318 + - 0.007162468883476318 - - 26 - - 0.00944017761948346 + - 0.00744017761948346 - - 27 - - 0.009719647763814041 + - 0.007719647763814041 - - 28 - - 0.01 + - 0.008 - - 29 - - 0.01028035223618596 + - 0.00828035223618596 - - 30 - - 0.010559822380516538 + - 0.00855982238051654 - - 31 - - 0.010837531116523682 + - 0.008837531116523682 - - 32 - - 0.011112604669781572 + - 0.009112604669781572 - - 33 - - 0.011384177557124247 + - 0.009384177557124247 - - 34 - - 0.011651395309775834 + - 0.009651395309775834 - - 35 - - 0.011913417161825448 + - 0.00991341716182545 - - 36 - - 0.01216941869558779 + - 0.01016941869558779 - - 37 - - 0.0124185944355262 + - 0.010418594435526198 - - 38 - - 0.012660160382576682 + - 0.010660160382576682 - - 39 - - 0.012893356480899029 + - 0.010893356480899029 - - 40 - - 0.013117449009293668 + - 0.011117449009293668 - - 41 - - 0.01333173288976002 + - 0.01133173288976002 - - 42 - - 0.013535533905932737 + - 0.011535533905932737 - - 43 - - 0.013728210824415828 + - 0.011728210824415828 - - 44 - - 0.01390915741234015 + - 0.011909157412340148 - - 45 - - 0.014077804344796302 + - 0.0120778043447963 - - 46 - - 0.014233620996141422 + - 0.01223362099614142 - - 47 - - 0.014376117109543769 + - 0.012376117109543769 - - 48 - - 0.014504844339512095 + - 0.012504844339512097 - - 49 - - 0.014619397662556434 + - 0.012619397662556434 - - 50 - - 0.014719416651541837 + - 0.012719416651541839 - - 51 - - 0.014804586609725497 + - 0.012804586609725499 - - 52 - - 0.014874639560909118 + - 0.012874639560909118 - - 53 - - 0.01492935509259118 + - 0.01292935509259118 - - 54 - - 0.014968561049466214 + - 0.012968561049466212 - - 55 - - 0.014992134075089083 + - 0.012992134075089083 - - 56 - - 0.015 + - 0.013000000000000001 - - 57 - - 0.014992134075089083 + - 0.012992134075089083 - - 58 - - 0.014968561049466212 + - 0.012968561049466212 - - 59 - - 0.01492935509259118 + - 0.01292935509259118 - - 60 - - 0.014874639560909118 + - 0.012874639560909118 - - 61 - - 0.014804586609725499 + - 0.012804586609725499 - - 62 - - 0.014719416651541837 + - 0.012719416651541839 - - 63 - - 0.014619397662556434 + - 0.012619397662556434 - - 64 - - 0.014504844339512095 + - 0.012504844339512097 - - 65 - - 0.014376117109543767 + - 0.012376117109543769 - - 66 - - 0.014233620996141422 + - 0.012233620996141422 - - 67 - - 0.014077804344796302 + - 0.012077804344796302 - - 68 - - 0.01390915741234015 + - 0.011909157412340152 - - 69 - - 0.013728210824415828 + - 0.011728210824415828 - - 70 - - 0.01353553390593274 + - 0.01153553390593274 - - 71 - - 0.01333173288976002 + - 0.01133173288976002 - - 72 - - 0.01311744900929367 + - 0.011117449009293668 - - 73 - - 0.012893356480899027 + - 0.010893356480899029 - - 74 - - 0.012660160382576684 + - 0.010660160382576684 - - 75 - - 0.012418594435526202 + - 0.010418594435526202 - - 76 - - 0.012169418695587792 + - 0.010169418695587792 - - 77 - - 0.011913417161825451 + - 0.009913417161825451 - - 78 - - 0.011651395309775837 + - 0.009651395309775837 - - 79 - - 0.011384177557124247 + - 0.009384177557124247 - - 80 - - 0.011112604669781574 + - 0.009112604669781574 - - 81 - - 0.010837531116523686 + - 0.008837531116523686 - - 82 - - 0.01055982238051654 + - 0.00855982238051654 - - 83 - - 0.010280352236185957 + - 0.008280352236185957 - - 84 - - 0.010000000000000002 + - 0.008000000000000002 - - 85 - - 0.009719647763814045 + - 0.007719647763814045 - - 86 - - 0.009440177619483462 + - 0.007440177619483462 - - 87 - - 0.009162468883476316 + - 0.007162468883476316 - - 88 - - 0.008887395330218428 + - 0.006887395330218429 - - 89 - - 0.008615822442875756 + - 0.006615822442875756 - - 90 - - 0.008348604690224165 + - 0.006348604690224166 - - 91 - - 0.00808658283817455 + - 0.00608658283817455 - - 92 - - 0.00783058130441221 + - 0.00583058130441221 - - 93 - - 0.0075814055644738 + - 0.0055814055644738 - - 94 - - 0.007339839617423318 + - 0.005339839617423318 - - 95 - - 0.007106643519100974 + - 0.005106643519100974 - - 96 - - 0.006882550990706333 + - 0.004882550990706333 - - 97 - - 0.006668267110239979 + - 0.004668267110239979 - - 98 - - 0.006464466094067263 + - 0.004464466094067263 - - 99 - - 0.006271789175584174 + - 0.004271789175584174 - - 100 - - 0.006090842587659851 + - 0.004090842587659851 - - 101 - - 0.0059221956552036985 + - 0.0039221956552036984 - - 102 - - 0.00576637900385858 + - 0.0037663790038585804 - - 103 - - 0.005623882890456233 + - 0.003623882890456233 - - 104 - - 0.005495155660487905 + - 0.0034951556604879046 - - 105 - - 0.005380602337443568 + - 0.003380602337443568 - - 106 - - 0.005280583348458163 + - 0.0032805833484581626 - - 107 - - 0.005195413390274502 + - 0.003195413390274502 - - 108 - - 0.005125360439090882 + - 0.0031253604390908823 - - 109 - - 0.005070644907408821 + - 0.003070644907408821 - - 110 - - 0.005031438950533787 + - 0.003031438950533787 - - 111 - - 0.005007865924910917 + - 0.003007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.013443725935320523 + noise: 0.029541906819651888 proportion: 0.16 targets: leHavre_fra: - noise: 0.030270714085038748 + noise: 0.027174439537617754 proportion: 0.18755329471737509 montreal_can: - noise: 0.013320576022818739 + noise: 0.00980727387825093 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07689493882565487 + noise: 0.0027637832634372895 proportion: 0.47933778254893905 pusan_kor: - noise: 0.007972433806655532 + noise: 0.014430384061284766 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.007497817787595211 + noise: 0.006930094460708154 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.007633866843340292 + noise: 0.008742270235780183 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0010106861866602764 + noise: 0.0011347602771777819 proportion: 0.005882857005910926 yantian_chn: - noise: 0.012219624836344655 + noise: 0.006193414953469088 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019530280872261515 + noise: 0.0012369701713498126 proportion: 0.01 targets: qingdao_chn: - noise: 0.0034939030178053614 + noise: 0.012364772365962309 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04233393468254242 + noise: 0.00352215419270645 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.021838198102471493 + noise: 0.028599483759999704 proportion: 0.24812321657873454 yantian_chn: - noise: 0.046242815176850596 + noise: 0.04900330203859365 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019129579921117862 + noise: 0.0009621506996928753 proportion: 0.01 targets: qingdao_chn: - noise: 0.012228512488579733 + noise: 0.026090492586688295 proportion: 0.19992517767067194 santos_bra: - noise: 0.028078880905400762 + noise: 0.012641742172183024 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.023876351340743802 + noise: 0.03176028945781009 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.029319437252031597 + noise: 0.009817528692331708 proportion: 0.19775168293424744 yantian_chn: - noise: 0.01928917747193642 + noise: 0.009621093160930289 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.00350760127602979 + noise: 0.0018886517487191057 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.032528716547168546 + noise: 0.004315181577345305 proportion: 0.2613085269688243 montreal_can: - noise: 0.014821251534050164 + noise: 0.016843903962712903 proportion: 0.09474419644790176 newYork_usa: - noise: 0.02447312721184167 + noise: 0.009488796573182388 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0043063159539580825 + noise: 0.016473206464419552 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0061997544295394206 + noise: 0.016694752769885985 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.0014225749496497644 + noise: 0.01034247956021821 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0049886669336311005 + noise: 0.0017025555020105283 proportion: 0.07609945087001035 yantian_chn: - noise: 0.010202155612950937 + noise: 0.012420348270095348 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007116233975121642 + noise: 0.0010398317467610486 proportion: 0.05 targets: oakland_usa: - noise: 0.021750420577675664 + noise: 0.046610961242872055 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.007223156875444034 + noise: 0.0034681253869941176 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.008409198610215574 + noise: 0.021860225648515103 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04468140938124822 + noise: 0.04086143525071624 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.022579209428659604 + noise: 0.003862724565463262 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.001237859415806274 + noise: 0.0076983570213705055 proportion: 0.05 targets: manzanillo_mex: - noise: 0.004468190881652269 + noise: 0.0046065639504877355 proportion: 0.1642819028757581 pusan_kor: - noise: 0.015630343651636142 + noise: 0.0025188189984588993 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.01705599320218467 + noise: 0.007167172404922409 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.002949720393204809 + noise: 0.004215477057755458 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0062556847598889565 + noise: 0.0015807008466467236 proportion: 0.11985637174894495 yantian_chn: - noise: 0.017417960137127892 + noise: 0.004717980724301031 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027064881430223564 + noise: 0.027332270387564594 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0022241630073084333 + noise: 0.00041927575320429856 proportion: 0.015 targets: singapore_sgp: - noise: 0.04113598506120082 + noise: 0.01720316773737656 proportion: 0.3293364398135728 sydney_aus: - noise: 0.05585356106243802 + noise: 0.0317483357682384 proportion: 0.3364188275147848 yantian_chn: - noise: 0.04970952158933521 + noise: 6.275255136458467e-05 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0023396017313775798 + noise: 0.0001058824653549524 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.029006641730691472 + noise: 0.08372460982561138 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.052743138595601397 + noise: 0.005206377376346192 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0029698121952597563 + noise: 0.0023971524264589056 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.002300273308223476 + noise: 0.10416372800484693 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.026329645545883667 + noise: 0.05774414602239579 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00034658625196087867 + noise: 0.005226544429947875 proportion: 0.03 targets: losAngeles_usa: - noise: 0.03805042564171647 + noise: 0.054178562561998066 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.026783528316198884 + noise: 0.044477996162498444 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.02520719401293405 + noise: 0.03359401622082758 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.011450474320078908 + noise: 0.04268416733729023 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027574439469690735 + noise: 0.0029718257861642474 proportion: 0.015 targets: losAngeles_usa: - noise: 0.030666144891490648 + noise: 0.008826102450863998 proportion: 0.2657898185062753 oakland_usa: - noise: 0.05069695864471698 + noise: 0.0011354503888720232 proportion: 0.26818216862044597 qingdao_chn: - noise: 1.5150697900596916e-05 + noise: 0.014679852245526353 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.005507254948856576 + noise: 0.044867678747918735 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.003886006717160586 + noise: 0.002973353584364918 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.027386818215617247 + noise: 0.015482405581896957 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.011340855749132506 + noise: 0.0001302647468009758 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.0015411008699796073 + noise: 0.010572876890368834 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0011819920685648456 + noise: 0.0025256790825975454 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.005415688613917366 + noise: 0.0010682303655455128 proportion: 0.035795894860646466 seattle_usa: - noise: 0.012679066272107449 + noise: 0.009613260507944536 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.004046325432066565 + noise: 0.0078571916664256 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.004754201755016008 + noise: 0.0034843695558064575 proportion: 0.04038858042581788 vancouver_can: - noise: 0.010845469930487786 + noise: 0.00964564143149089 proportion: 0.059258114284493034 yantian_chn: - noise: 0.009847287555290789 + noise: 0.006902002888592339 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.016857865956875252 + noise: 0.011337884438636026 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0013405281331279736 + noise: 0.010033077426210528 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.017720647298623885 + noise: 0.02614017182248326 proportion: 0.19166868266386958 durban_sau: - noise: 0.004430489262425184 + noise: 0.0017387242678691362 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0029551319318284 + noise: 0.0003486452742150132 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.00884618941305856 + noise: 0.009182092408099281 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.008287055306659491 + noise: 0.022644078007304263 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.010416910937371144 + noise: 0.0076428490407138075 proportion: 0.061252276599797005 oakland_usa: - noise: 0.030726016025509867 + noise: 0.00338044200189517 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.001029469211236195 + noise: 0.0005795702643972235 proportion: 0.005409393840032325 pusan_kor: - noise: 0.00253441394213481 + noise: 0.0034591090510660938 proportion: 0.018577689927305203 santos_bra: - noise: 0.0012007740198499907 + noise: 0.0019028622663675436 proportion: 0.02037439104592543 seattle_usa: - noise: 0.015740512852146334 + noise: 0.0022840751022966794 proportion: 0.113038562331156 shanghai_chn: - noise: 0.001828465916657425 + noise: 0.0013813896490110294 proportion: 0.010504586083902057 vancouver_can: - noise: 0.000962793819981486 + noise: 0.0014244818796804444 proportion: 0.02008850220677704 yantian_chn: - noise: 0.001870686969127809 + noise: 0.0026191834198310256 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.020726812866609105 + noise: 0.003894234191508894 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.00046662157321829305 + noise: 0.0012134052104793088 proportion: 0.01 targets: manzanillo_mex: - noise: 0.0335790014316909 + noise: 0.012532297887460412 proportion: 0.1695702560614863 pusan_kor: - noise: 0.019876836766735944 + noise: 0.01302248526372375 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.021055304334577304 + noise: 0.005397619577307389 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.010351683215713024 + noise: 0.01679312314459858 proportion: 0.16105317774270345 yantian_chn: - noise: 0.020655951601841832 + noise: 0.019729642431771596 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.009059407942596073 + noise: 0.0055375795509528414 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003480997833509656 + noise: 0.001877414087116521 proportion: 0.01 targets: itagual_bra: - noise: 0.020657961926928516 + noise: 0.032004242821693965 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.013072578761377065 + noise: 0.02033932536567358 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.027172218926956353 + noise: 0.03140598123730028 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.028255176146783356 + noise: 0.01821241418824103 proportion: 0.19775168256638195 yantian_chn: - noise: 0.02522960406069968 + noise: 0.0026235148173812395 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.0007339846715492771 + noise: 0.003107859253019168 proportion: 0.07 targets: losAngeles_usa: - noise: 0.005803300102787883 + noise: 0.05753073850487432 proportion: 0.2912736754142012 pusan_kor: - noise: 0.011767093399526167 + noise: 0.0016502073135337876 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.01342850609637382 + noise: 0.011314497001275887 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.02208223845904732 + noise: 0.005508132238408478 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.01317084017907106 + noise: 0.019332283176789165 proportion: 0.09977785851511455 vancouver_can: - noise: 0.0032415669173149184 + noise: 0.006127488353504421 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01697269521746073 + noise: 0.01754766809268637 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.014530243985042664 + noise: 0.017095220699748878 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.02131285237332896 + noise: 0.041084325927985985 proportion: 0.21398371679064213 durban_sau: - noise: 0.002948998809093681 + noise: 0.0021696529552618954 proportion: 0.017462167174606275 itagual_bra: - noise: 0.001713993122608175 + noise: 0.0008030025073271739 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009800848688656188 + noise: 0.0015848506299856926 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.0050873385069792705 + noise: 0.00755174044562672 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.004983219928480878 + noise: 0.011854629177267675 proportion: 0.05976808154382374 oakland_usa: - noise: 0.021596249916838263 + noise: 0.028784906675318727 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0014764151425764754 + noise: 0.0017948328245855443 proportion: 0.00930596400725694 qingdao_chn: - noise: 2.741759926803036e-05 + noise: 0.000182985585552497 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0003052926172722117 + noise: 0.0007693144229259965 proportion: 0.011430536346128936 seattle_usa: - noise: 0.01952308695587358 + noise: 0.015979262018439678 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0019949337867570943 + noise: 0.0006937704178989623 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0005520948508266831 + noise: 0.0012210056169907513 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.015187739134572683 + noise: 0.010669005317136996 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.005693120029153821 + noise: 0.0012836259212510967 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.020122388762735893 + noise: 0.02731130789420123 proportion: 0.16163465526933787 durban_sau: - noise: 0.0019491514734383516 + noise: 0.0079917530205346 proportion: 0.052947229587582224 itagual_bra: - noise: 0.0002586292721110565 + noise: 0.007301258651251609 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.004984389187243039 + noise: 0.0022920930271172033 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.0015861611856993322 + noise: 0.000927122980718493 proportion: 0.054598902525719965 pusan_kor: - noise: 0.006025000972759821 + noise: 0.001481325232631238 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0004286935806667211 + noise: 0.0035672054884738702 proportion: 0.04380756610509279 santos_bra: - noise: 0.003416715058071535 + noise: 0.0072911626019552455 proportion: 0.0496114180206766 seattle_usa: - noise: 0.007700381604340727 + noise: 0.021977682321328896 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.003544364668028845 + noise: 0.006000301686369274 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.002802086921079384 + noise: 0.005118668874191572 proportion: 0.03556597867096123 sydney_aus: - noise: 0.010185014617976348 + noise: 0.0014991769548569809 proportion: 0.053961624659387086 vancouver_can: - noise: 0.002789491330076127 + noise: 0.008355987327740363 proportion: 0.04942443509903704 yantian_chn: - noise: 0.005000384119150195 + noise: 0.00424493151411591 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.008577499395403343 + noise: 0.023481573062834743 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002150752663893203 + noise: 0.002155120895930923 proportion: 0.015 targets: melbourne_aus: - noise: 0.05922344082123652 + noise: 0.043272556095345846 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.05193975256137971 + noise: 0.021150293369866142 proportion: 0.3291642505650358 yantian_chn: - noise: 0.061788693147246415 + noise: 0.032126637177988214 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002068294648050253 + noise: 0.0017361691924081258 proportion: 0.02 targets: pusan_kor: - noise: 0.016845200307234364 + noise: 0.030070192002213465 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.014999981061310954 + noise: 0.0007756258463724296 proportion: 0.16078294599848347 seattle_usa: - noise: 0.01896644075283542 + noise: 0.034787830472740866 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.0077549932712456865 + noise: 0.028936107345725295 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.02055123864749911 + noise: 0.009484290050201566 proportion: 0.15641751563334233 yantian_chn: - noise: 0.03050803433828264 + noise: 0.0057514035358065966 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.002609757843993272 + noise: 0.008422256646885302 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.025222997739158936 + noise: 0.011723548393014914 proportion: 0.23063506921338092 durban_sau: - noise: 0.0018608540738386267 + noise: 0.007028309982650573 proportion: 0.036977112629701755 itagual_bra: - noise: 0.004923606222292092 + noise: 0.0021232511744929236 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.012389321950936184 + noise: 0.01244233221440464 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.003548726911160303 + noise: 0.005219875180760516 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.000882486825036804 + noise: 0.00325693140987167 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0005349297708399651 + noise: 0.0020033324939384353 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0007216029643777133 + noise: 0.0024288519568081467 proportion: 0.020692152164438926 santos_bra: - noise: 0.0008948241044821844 + noise: 0.005917956078164042 proportion: 0.03103337095193521 seattle_usa: - noise: 0.006808164648780424 + noise: 0.008224490506305046 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0019668709850992473 + noise: 0.0012713160693603898 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0008244631028521047 + noise: 0.0005993163297166358 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003274678869997879 + noise: 0.003553789802863408 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0003213862877618055 + noise: 0.005818365387463014 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0026076979418575303 + noise: 0.000937390505729158 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.026806722998433646 + noise: 0.0075575175422493215 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.011506949353344573 + noise: 0.0008778537933683098 proportion: 0.08 targets: manzanillo_mex: - noise: 0.042678902760188174 + noise: 0.011810938798409994 proportion: 0.224773870587767 pusan_kor: - noise: 0.02092931566180752 + noise: 0.022595884352223653 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.012790853044052902 + noise: 0.024907581311612293 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.00713764692173517 + noise: 0.008287924815679014 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.018867879170398616 + noise: 0.0066037712087852 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.014299288167726593 + noise: 0.016272909688446892 proportion: 0.1115894561579222 yantian_chn: - noise: 0.010558592890221315 + noise: 0.020166976986305943 proportion: 0.14697441091807414 routes: a3s: @@ -1169,7 +1169,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml index f7c988233..c989dd410 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml @@ -2,229 +2,229 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.005 + - 0.003 - - 1 - - 0.005007865924910917 + - 0.003007865924910917 - - 2 - - 0.005031438950533787 + - 0.003031438950533787 - - 3 - - 0.005070644907408821 + - 0.003070644907408821 - - 4 - - 0.005125360439090882 + - 0.0031253604390908823 - - 5 - - 0.005195413390274502 + - 0.003195413390274502 - - 6 - - 0.005280583348458163 + - 0.0032805833484581626 - - 7 - - 0.005380602337443566 + - 0.003380602337443566 - - 8 - - 0.005495155660487905 + - 0.0034951556604879046 - - 9 - - 0.0056238828904562315 + - 0.0036238828904562315 - - 10 - - 0.0057663790038585796 + - 0.0037663790038585795 - - 11 - - 0.005922195655203699 + - 0.003922195655203699 - - 12 - - 0.006090842587659851 + - 0.004090842587659851 - - 13 - - 0.006271789175584172 + - 0.004271789175584172 - - 14 - - 0.006464466094067262 + - 0.004464466094067262 - - 15 - - 0.006668267110239981 + - 0.004668267110239981 - - 16 - - 0.006882550990706332 + - 0.004882550990706332 - - 17 - - 0.007106643519100972 + - 0.0051066435191009715 - - 18 - - 0.007339839617423317 + - 0.005339839617423317 - - 19 - - 0.007581405564473801 + - 0.005581405564473801 - - 20 - - 0.007830581304412209 + - 0.005830581304412209 - - 21 - - 0.00808658283817455 + - 0.006086582838174551 - - 22 - - 0.008348604690224165 + - 0.006348604690224164 - - 23 - - 0.008615822442875754 + - 0.006615822442875753 - - 24 - - 0.008887395330218428 + - 0.006887395330218428 - - 25 - - 0.009162468883476318 + - 0.007162468883476318 - - 26 - - 0.00944017761948346 + - 0.00744017761948346 - - 27 - - 0.009719647763814041 + - 0.007719647763814041 - - 28 - - 0.01 + - 0.008 - - 29 - - 0.01028035223618596 + - 0.00828035223618596 - - 30 - - 0.010559822380516538 + - 0.00855982238051654 - - 31 - - 0.010837531116523682 + - 0.008837531116523682 - - 32 - - 0.011112604669781572 + - 0.009112604669781572 - - 33 - - 0.011384177557124247 + - 0.009384177557124247 - - 34 - - 0.011651395309775834 + - 0.009651395309775834 - - 35 - - 0.011913417161825448 + - 0.00991341716182545 - - 36 - - 0.01216941869558779 + - 0.01016941869558779 - - 37 - - 0.0124185944355262 + - 0.010418594435526198 - - 38 - - 0.012660160382576682 + - 0.010660160382576682 - - 39 - - 0.012893356480899029 + - 0.010893356480899029 - - 40 - - 0.013117449009293668 + - 0.011117449009293668 - - 41 - - 0.01333173288976002 + - 0.01133173288976002 - - 42 - - 0.013535533905932737 + - 0.011535533905932737 - - 43 - - 0.013728210824415828 + - 0.011728210824415828 - - 44 - - 0.01390915741234015 + - 0.011909157412340148 - - 45 - - 0.014077804344796302 + - 0.0120778043447963 - - 46 - - 0.014233620996141422 + - 0.01223362099614142 - - 47 - - 0.014376117109543769 + - 0.012376117109543769 - - 48 - - 0.014504844339512095 + - 0.012504844339512097 - - 49 - - 0.014619397662556434 + - 0.012619397662556434 - - 50 - - 0.014719416651541837 + - 0.012719416651541839 - - 51 - - 0.014804586609725497 + - 0.012804586609725499 - - 52 - - 0.014874639560909118 + - 0.012874639560909118 - - 53 - - 0.01492935509259118 + - 0.01292935509259118 - - 54 - - 0.014968561049466214 + - 0.012968561049466212 - - 55 - - 0.014992134075089083 + - 0.012992134075089083 - - 56 - - 0.015 + - 0.013000000000000001 - - 57 - - 0.014992134075089083 + - 0.012992134075089083 - - 58 - - 0.014968561049466212 + - 0.012968561049466212 - - 59 - - 0.01492935509259118 + - 0.01292935509259118 - - 60 - - 0.014874639560909118 + - 0.012874639560909118 - - 61 - - 0.014804586609725499 + - 0.012804586609725499 - - 62 - - 0.014719416651541837 + - 0.012719416651541839 - - 63 - - 0.014619397662556434 + - 0.012619397662556434 - - 64 - - 0.014504844339512095 + - 0.012504844339512097 - - 65 - - 0.014376117109543767 + - 0.012376117109543769 - - 66 - - 0.014233620996141422 + - 0.012233620996141422 - - 67 - - 0.014077804344796302 + - 0.012077804344796302 - - 68 - - 0.01390915741234015 + - 0.011909157412340152 - - 69 - - 0.013728210824415828 + - 0.011728210824415828 - - 70 - - 0.01353553390593274 + - 0.01153553390593274 - - 71 - - 0.01333173288976002 + - 0.01133173288976002 - - 72 - - 0.01311744900929367 + - 0.011117449009293668 - - 73 - - 0.012893356480899027 + - 0.010893356480899029 - - 74 - - 0.012660160382576684 + - 0.010660160382576684 - - 75 - - 0.012418594435526202 + - 0.010418594435526202 - - 76 - - 0.012169418695587792 + - 0.010169418695587792 - - 77 - - 0.011913417161825451 + - 0.009913417161825451 - - 78 - - 0.011651395309775837 + - 0.009651395309775837 - - 79 - - 0.011384177557124247 + - 0.009384177557124247 - - 80 - - 0.011112604669781574 + - 0.009112604669781574 - - 81 - - 0.010837531116523686 + - 0.008837531116523686 - - 82 - - 0.01055982238051654 + - 0.00855982238051654 - - 83 - - 0.010280352236185957 + - 0.008280352236185957 - - 84 - - 0.010000000000000002 + - 0.008000000000000002 - - 85 - - 0.009719647763814045 + - 0.007719647763814045 - - 86 - - 0.009440177619483462 + - 0.007440177619483462 - - 87 - - 0.009162468883476316 + - 0.007162468883476316 - - 88 - - 0.008887395330218428 + - 0.006887395330218429 - - 89 - - 0.008615822442875756 + - 0.006615822442875756 - - 90 - - 0.008348604690224165 + - 0.006348604690224166 - - 91 - - 0.00808658283817455 + - 0.00608658283817455 - - 92 - - 0.00783058130441221 + - 0.00583058130441221 - - 93 - - 0.0075814055644738 + - 0.0055814055644738 - - 94 - - 0.007339839617423318 + - 0.005339839617423318 - - 95 - - 0.007106643519100974 + - 0.005106643519100974 - - 96 - - 0.006882550990706333 + - 0.004882550990706333 - - 97 - - 0.006668267110239979 + - 0.004668267110239979 - - 98 - - 0.006464466094067263 + - 0.004464466094067263 - - 99 - - 0.006271789175584174 + - 0.004271789175584174 - - 100 - - 0.006090842587659851 + - 0.004090842587659851 - - 101 - - 0.0059221956552036985 + - 0.0039221956552036984 - - 102 - - 0.00576637900385858 + - 0.0037663790038585804 - - 103 - - 0.005623882890456233 + - 0.003623882890456233 - - 104 - - 0.005495155660487905 + - 0.0034951556604879046 - - 105 - - 0.005380602337443568 + - 0.003380602337443568 - - 106 - - 0.005280583348458163 + - 0.0032805833484581626 - - 107 - - 0.005195413390274502 + - 0.003195413390274502 - - 108 - - 0.005125360439090882 + - 0.0031253604390908823 - - 109 - - 0.005070644907408821 + - 0.003070644907408821 - - 110 - - 0.005031438950533787 + - 0.003031438950533787 - - 111 - - 0.005007865924910917 + - 0.003007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.013443725935320523 + noise: 0.029541906819651888 proportion: 0.16 targets: leHavre_fra: - noise: 0.030270714085038748 + noise: 0.027174439537617754 proportion: 0.18755329471737509 montreal_can: - noise: 0.013320576022818739 + noise: 0.00980727387825093 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07689493882565487 + noise: 0.0027637832634372895 proportion: 0.47933778254893905 pusan_kor: - noise: 0.007972433806655532 + noise: 0.014430384061284766 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.007497817787595211 + noise: 0.006930094460708154 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.007633866843340292 + noise: 0.008742270235780183 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0010106861866602764 + noise: 0.0011347602771777819 proportion: 0.005882857005910926 yantian_chn: - noise: 0.012219624836344655 + noise: 0.006193414953469088 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019530280872261515 + noise: 0.0012369701713498126 proportion: 0.01 targets: qingdao_chn: - noise: 0.0034939030178053614 + noise: 0.012364772365962309 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04233393468254242 + noise: 0.00352215419270645 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.021838198102471493 + noise: 0.028599483759999704 proportion: 0.24812321657873454 yantian_chn: - noise: 0.046242815176850596 + noise: 0.04900330203859365 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019129579921117862 + noise: 0.0009621506996928753 proportion: 0.01 targets: qingdao_chn: - noise: 0.012228512488579733 + noise: 0.026090492586688295 proportion: 0.19992517767067194 santos_bra: - noise: 0.028078880905400762 + noise: 0.012641742172183024 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.023876351340743802 + noise: 0.03176028945781009 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.029319437252031597 + noise: 0.009817528692331708 proportion: 0.19775168293424744 yantian_chn: - noise: 0.01928917747193642 + noise: 0.009621093160930289 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.00350760127602979 + noise: 0.0018886517487191057 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.032528716547168546 + noise: 0.004315181577345305 proportion: 0.2613085269688243 montreal_can: - noise: 0.014821251534050164 + noise: 0.016843903962712903 proportion: 0.09474419644790176 newYork_usa: - noise: 0.02447312721184167 + noise: 0.009488796573182388 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0043063159539580825 + noise: 0.016473206464419552 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0061997544295394206 + noise: 0.016694752769885985 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.0014225749496497644 + noise: 0.01034247956021821 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0049886669336311005 + noise: 0.0017025555020105283 proportion: 0.07609945087001035 yantian_chn: - noise: 0.010202155612950937 + noise: 0.012420348270095348 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007116233975121642 + noise: 0.0010398317467610486 proportion: 0.05 targets: oakland_usa: - noise: 0.021750420577675664 + noise: 0.046610961242872055 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.007223156875444034 + noise: 0.0034681253869941176 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.008409198610215574 + noise: 0.021860225648515103 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04468140938124822 + noise: 0.04086143525071624 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.022579209428659604 + noise: 0.003862724565463262 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.001237859415806274 + noise: 0.0076983570213705055 proportion: 0.05 targets: manzanillo_mex: - noise: 0.004468190881652269 + noise: 0.0046065639504877355 proportion: 0.1642819028757581 pusan_kor: - noise: 0.015630343651636142 + noise: 0.0025188189984588993 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.01705599320218467 + noise: 0.007167172404922409 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.002949720393204809 + noise: 0.004215477057755458 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0062556847598889565 + noise: 0.0015807008466467236 proportion: 0.11985637174894495 yantian_chn: - noise: 0.017417960137127892 + noise: 0.004717980724301031 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027064881430223564 + noise: 0.027332270387564594 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0022241630073084333 + noise: 0.00041927575320429856 proportion: 0.015 targets: singapore_sgp: - noise: 0.04113598506120082 + noise: 0.01720316773737656 proportion: 0.3293364398135728 sydney_aus: - noise: 0.05585356106243802 + noise: 0.0317483357682384 proportion: 0.3364188275147848 yantian_chn: - noise: 0.04970952158933521 + noise: 6.275255136458467e-05 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0023396017313775798 + noise: 0.0001058824653549524 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.029006641730691472 + noise: 0.08372460982561138 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.052743138595601397 + noise: 0.005206377376346192 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0029698121952597563 + noise: 0.0023971524264589056 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.002300273308223476 + noise: 0.10416372800484693 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.026329645545883667 + noise: 0.05774414602239579 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00034658625196087867 + noise: 0.005226544429947875 proportion: 0.03 targets: losAngeles_usa: - noise: 0.03805042564171647 + noise: 0.054178562561998066 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.026783528316198884 + noise: 0.044477996162498444 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.02520719401293405 + noise: 0.03359401622082758 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.011450474320078908 + noise: 0.04268416733729023 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027574439469690735 + noise: 0.0029718257861642474 proportion: 0.015 targets: losAngeles_usa: - noise: 0.030666144891490648 + noise: 0.008826102450863998 proportion: 0.2657898185062753 oakland_usa: - noise: 0.05069695864471698 + noise: 0.0011354503888720232 proportion: 0.26818216862044597 qingdao_chn: - noise: 1.5150697900596916e-05 + noise: 0.014679852245526353 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.005507254948856576 + noise: 0.044867678747918735 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.003886006717160586 + noise: 0.002973353584364918 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.027386818215617247 + noise: 0.015482405581896957 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.011340855749132506 + noise: 0.0001302647468009758 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.0015411008699796073 + noise: 0.010572876890368834 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0011819920685648456 + noise: 0.0025256790825975454 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.005415688613917366 + noise: 0.0010682303655455128 proportion: 0.035795894860646466 seattle_usa: - noise: 0.012679066272107449 + noise: 0.009613260507944536 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.004046325432066565 + noise: 0.0078571916664256 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.004754201755016008 + noise: 0.0034843695558064575 proportion: 0.04038858042581788 vancouver_can: - noise: 0.010845469930487786 + noise: 0.00964564143149089 proportion: 0.059258114284493034 yantian_chn: - noise: 0.009847287555290789 + noise: 0.006902002888592339 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.016857865956875252 + noise: 0.011337884438636026 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0013405281331279736 + noise: 0.010033077426210528 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.017720647298623885 + noise: 0.02614017182248326 proportion: 0.19166868266386958 durban_sau: - noise: 0.004430489262425184 + noise: 0.0017387242678691362 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0029551319318284 + noise: 0.0003486452742150132 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.00884618941305856 + noise: 0.009182092408099281 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.008287055306659491 + noise: 0.022644078007304263 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.010416910937371144 + noise: 0.0076428490407138075 proportion: 0.061252276599797005 oakland_usa: - noise: 0.030726016025509867 + noise: 0.00338044200189517 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.001029469211236195 + noise: 0.0005795702643972235 proportion: 0.005409393840032325 pusan_kor: - noise: 0.00253441394213481 + noise: 0.0034591090510660938 proportion: 0.018577689927305203 santos_bra: - noise: 0.0012007740198499907 + noise: 0.0019028622663675436 proportion: 0.02037439104592543 seattle_usa: - noise: 0.015740512852146334 + noise: 0.0022840751022966794 proportion: 0.113038562331156 shanghai_chn: - noise: 0.001828465916657425 + noise: 0.0013813896490110294 proportion: 0.010504586083902057 vancouver_can: - noise: 0.000962793819981486 + noise: 0.0014244818796804444 proportion: 0.02008850220677704 yantian_chn: - noise: 0.001870686969127809 + noise: 0.0026191834198310256 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.020726812866609105 + noise: 0.003894234191508894 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.00046662157321829305 + noise: 0.0012134052104793088 proportion: 0.01 targets: manzanillo_mex: - noise: 0.0335790014316909 + noise: 0.012532297887460412 proportion: 0.1695702560614863 pusan_kor: - noise: 0.019876836766735944 + noise: 0.01302248526372375 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.021055304334577304 + noise: 0.005397619577307389 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.010351683215713024 + noise: 0.01679312314459858 proportion: 0.16105317774270345 yantian_chn: - noise: 0.020655951601841832 + noise: 0.019729642431771596 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.009059407942596073 + noise: 0.0055375795509528414 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003480997833509656 + noise: 0.001877414087116521 proportion: 0.01 targets: itagual_bra: - noise: 0.020657961926928516 + noise: 0.032004242821693965 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.013072578761377065 + noise: 0.02033932536567358 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.027172218926956353 + noise: 0.03140598123730028 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.028255176146783356 + noise: 0.01821241418824103 proportion: 0.19775168256638195 yantian_chn: - noise: 0.02522960406069968 + noise: 0.0026235148173812395 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.0007339846715492771 + noise: 0.003107859253019168 proportion: 0.07 targets: losAngeles_usa: - noise: 0.005803300102787883 + noise: 0.05753073850487432 proportion: 0.2912736754142012 pusan_kor: - noise: 0.011767093399526167 + noise: 0.0016502073135337876 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.01342850609637382 + noise: 0.011314497001275887 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.02208223845904732 + noise: 0.005508132238408478 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.01317084017907106 + noise: 0.019332283176789165 proportion: 0.09977785851511455 vancouver_can: - noise: 0.0032415669173149184 + noise: 0.006127488353504421 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01697269521746073 + noise: 0.01754766809268637 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.014530243985042664 + noise: 0.017095220699748878 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.02131285237332896 + noise: 0.041084325927985985 proportion: 0.21398371679064213 durban_sau: - noise: 0.002948998809093681 + noise: 0.0021696529552618954 proportion: 0.017462167174606275 itagual_bra: - noise: 0.001713993122608175 + noise: 0.0008030025073271739 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009800848688656188 + noise: 0.0015848506299856926 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.0050873385069792705 + noise: 0.00755174044562672 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.004983219928480878 + noise: 0.011854629177267675 proportion: 0.05976808154382374 oakland_usa: - noise: 0.021596249916838263 + noise: 0.028784906675318727 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0014764151425764754 + noise: 0.0017948328245855443 proportion: 0.00930596400725694 qingdao_chn: - noise: 2.741759926803036e-05 + noise: 0.000182985585552497 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0003052926172722117 + noise: 0.0007693144229259965 proportion: 0.011430536346128936 seattle_usa: - noise: 0.01952308695587358 + noise: 0.015979262018439678 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0019949337867570943 + noise: 0.0006937704178989623 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0005520948508266831 + noise: 0.0012210056169907513 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.015187739134572683 + noise: 0.010669005317136996 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.005693120029153821 + noise: 0.0012836259212510967 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.020122388762735893 + noise: 0.02731130789420123 proportion: 0.16163465526933787 durban_sau: - noise: 0.0019491514734383516 + noise: 0.0079917530205346 proportion: 0.052947229587582224 itagual_bra: - noise: 0.0002586292721110565 + noise: 0.007301258651251609 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.004984389187243039 + noise: 0.0022920930271172033 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.0015861611856993322 + noise: 0.000927122980718493 proportion: 0.054598902525719965 pusan_kor: - noise: 0.006025000972759821 + noise: 0.001481325232631238 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0004286935806667211 + noise: 0.0035672054884738702 proportion: 0.04380756610509279 santos_bra: - noise: 0.003416715058071535 + noise: 0.0072911626019552455 proportion: 0.0496114180206766 seattle_usa: - noise: 0.007700381604340727 + noise: 0.021977682321328896 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.003544364668028845 + noise: 0.006000301686369274 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.002802086921079384 + noise: 0.005118668874191572 proportion: 0.03556597867096123 sydney_aus: - noise: 0.010185014617976348 + noise: 0.0014991769548569809 proportion: 0.053961624659387086 vancouver_can: - noise: 0.002789491330076127 + noise: 0.008355987327740363 proportion: 0.04942443509903704 yantian_chn: - noise: 0.005000384119150195 + noise: 0.00424493151411591 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.008577499395403343 + noise: 0.023481573062834743 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002150752663893203 + noise: 0.002155120895930923 proportion: 0.015 targets: melbourne_aus: - noise: 0.05922344082123652 + noise: 0.043272556095345846 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.05193975256137971 + noise: 0.021150293369866142 proportion: 0.3291642505650358 yantian_chn: - noise: 0.061788693147246415 + noise: 0.032126637177988214 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002068294648050253 + noise: 0.0017361691924081258 proportion: 0.02 targets: pusan_kor: - noise: 0.016845200307234364 + noise: 0.030070192002213465 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.014999981061310954 + noise: 0.0007756258463724296 proportion: 0.16078294599848347 seattle_usa: - noise: 0.01896644075283542 + noise: 0.034787830472740866 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.0077549932712456865 + noise: 0.028936107345725295 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.02055123864749911 + noise: 0.009484290050201566 proportion: 0.15641751563334233 yantian_chn: - noise: 0.03050803433828264 + noise: 0.0057514035358065966 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.002609757843993272 + noise: 0.008422256646885302 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.025222997739158936 + noise: 0.011723548393014914 proportion: 0.23063506921338092 durban_sau: - noise: 0.0018608540738386267 + noise: 0.007028309982650573 proportion: 0.036977112629701755 itagual_bra: - noise: 0.004923606222292092 + noise: 0.0021232511744929236 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.012389321950936184 + noise: 0.01244233221440464 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.003548726911160303 + noise: 0.005219875180760516 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.000882486825036804 + noise: 0.00325693140987167 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0005349297708399651 + noise: 0.0020033324939384353 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0007216029643777133 + noise: 0.0024288519568081467 proportion: 0.020692152164438926 santos_bra: - noise: 0.0008948241044821844 + noise: 0.005917956078164042 proportion: 0.03103337095193521 seattle_usa: - noise: 0.006808164648780424 + noise: 0.008224490506305046 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0019668709850992473 + noise: 0.0012713160693603898 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0008244631028521047 + noise: 0.0005993163297166358 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003274678869997879 + noise: 0.003553789802863408 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0003213862877618055 + noise: 0.005818365387463014 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0026076979418575303 + noise: 0.000937390505729158 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.026806722998433646 + noise: 0.0075575175422493215 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.011506949353344573 + noise: 0.0008778537933683098 proportion: 0.08 targets: manzanillo_mex: - noise: 0.042678902760188174 + noise: 0.011810938798409994 proportion: 0.224773870587767 pusan_kor: - noise: 0.02092931566180752 + noise: 0.022595884352223653 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.012790853044052902 + noise: 0.024907581311612293 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.00713764692173517 + noise: 0.008287924815679014 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.018867879170398616 + noise: 0.0066037712087852 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.014299288167726593 + noise: 0.016272909688446892 proportion: 0.1115894561579222 yantian_chn: - noise: 0.010558592890221315 + noise: 0.020166976986305943 proportion: 0.14697441091807414 routes: a3s: @@ -1169,7 +1169,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 290 + capacity: 696 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 164 + capacity: 394 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 1727 + capacity: 4146 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 344 + capacity: 826 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 424 + capacity: 1019 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 1981 + capacity: 4754 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 1476 + capacity: 3544 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 733 + capacity: 1759 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 638 + capacity: 1533 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 269 + capacity: 646 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 194 + capacity: 465 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 355 + capacity: 853 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 1899 + capacity: 4559 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml index 8b4a802a9..1157e932a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml @@ -2,229 +2,229 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.005 + - 0.003 - - 1 - - 0.005007865924910917 + - 0.003007865924910917 - - 2 - - 0.005031438950533787 + - 0.003031438950533787 - - 3 - - 0.005070644907408821 + - 0.003070644907408821 - - 4 - - 0.005125360439090882 + - 0.0031253604390908823 - - 5 - - 0.005195413390274502 + - 0.003195413390274502 - - 6 - - 0.005280583348458163 + - 0.0032805833484581626 - - 7 - - 0.005380602337443566 + - 0.003380602337443566 - - 8 - - 0.005495155660487905 + - 0.0034951556604879046 - - 9 - - 0.0056238828904562315 + - 0.0036238828904562315 - - 10 - - 0.0057663790038585796 + - 0.0037663790038585795 - - 11 - - 0.005922195655203699 + - 0.003922195655203699 - - 12 - - 0.006090842587659851 + - 0.004090842587659851 - - 13 - - 0.006271789175584172 + - 0.004271789175584172 - - 14 - - 0.006464466094067262 + - 0.004464466094067262 - - 15 - - 0.006668267110239981 + - 0.004668267110239981 - - 16 - - 0.006882550990706332 + - 0.004882550990706332 - - 17 - - 0.007106643519100972 + - 0.0051066435191009715 - - 18 - - 0.007339839617423317 + - 0.005339839617423317 - - 19 - - 0.007581405564473801 + - 0.005581405564473801 - - 20 - - 0.007830581304412209 + - 0.005830581304412209 - - 21 - - 0.00808658283817455 + - 0.006086582838174551 - - 22 - - 0.008348604690224165 + - 0.006348604690224164 - - 23 - - 0.008615822442875754 + - 0.006615822442875753 - - 24 - - 0.008887395330218428 + - 0.006887395330218428 - - 25 - - 0.009162468883476318 + - 0.007162468883476318 - - 26 - - 0.00944017761948346 + - 0.00744017761948346 - - 27 - - 0.009719647763814041 + - 0.007719647763814041 - - 28 - - 0.01 + - 0.008 - - 29 - - 0.01028035223618596 + - 0.00828035223618596 - - 30 - - 0.010559822380516538 + - 0.00855982238051654 - - 31 - - 0.010837531116523682 + - 0.008837531116523682 - - 32 - - 0.011112604669781572 + - 0.009112604669781572 - - 33 - - 0.011384177557124247 + - 0.009384177557124247 - - 34 - - 0.011651395309775834 + - 0.009651395309775834 - - 35 - - 0.011913417161825448 + - 0.00991341716182545 - - 36 - - 0.01216941869558779 + - 0.01016941869558779 - - 37 - - 0.0124185944355262 + - 0.010418594435526198 - - 38 - - 0.012660160382576682 + - 0.010660160382576682 - - 39 - - 0.012893356480899029 + - 0.010893356480899029 - - 40 - - 0.013117449009293668 + - 0.011117449009293668 - - 41 - - 0.01333173288976002 + - 0.01133173288976002 - - 42 - - 0.013535533905932737 + - 0.011535533905932737 - - 43 - - 0.013728210824415828 + - 0.011728210824415828 - - 44 - - 0.01390915741234015 + - 0.011909157412340148 - - 45 - - 0.014077804344796302 + - 0.0120778043447963 - - 46 - - 0.014233620996141422 + - 0.01223362099614142 - - 47 - - 0.014376117109543769 + - 0.012376117109543769 - - 48 - - 0.014504844339512095 + - 0.012504844339512097 - - 49 - - 0.014619397662556434 + - 0.012619397662556434 - - 50 - - 0.014719416651541837 + - 0.012719416651541839 - - 51 - - 0.014804586609725497 + - 0.012804586609725499 - - 52 - - 0.014874639560909118 + - 0.012874639560909118 - - 53 - - 0.01492935509259118 + - 0.01292935509259118 - - 54 - - 0.014968561049466214 + - 0.012968561049466212 - - 55 - - 0.014992134075089083 + - 0.012992134075089083 - - 56 - - 0.015 + - 0.013000000000000001 - - 57 - - 0.014992134075089083 + - 0.012992134075089083 - - 58 - - 0.014968561049466212 + - 0.012968561049466212 - - 59 - - 0.01492935509259118 + - 0.01292935509259118 - - 60 - - 0.014874639560909118 + - 0.012874639560909118 - - 61 - - 0.014804586609725499 + - 0.012804586609725499 - - 62 - - 0.014719416651541837 + - 0.012719416651541839 - - 63 - - 0.014619397662556434 + - 0.012619397662556434 - - 64 - - 0.014504844339512095 + - 0.012504844339512097 - - 65 - - 0.014376117109543767 + - 0.012376117109543769 - - 66 - - 0.014233620996141422 + - 0.012233620996141422 - - 67 - - 0.014077804344796302 + - 0.012077804344796302 - - 68 - - 0.01390915741234015 + - 0.011909157412340152 - - 69 - - 0.013728210824415828 + - 0.011728210824415828 - - 70 - - 0.01353553390593274 + - 0.01153553390593274 - - 71 - - 0.01333173288976002 + - 0.01133173288976002 - - 72 - - 0.01311744900929367 + - 0.011117449009293668 - - 73 - - 0.012893356480899027 + - 0.010893356480899029 - - 74 - - 0.012660160382576684 + - 0.010660160382576684 - - 75 - - 0.012418594435526202 + - 0.010418594435526202 - - 76 - - 0.012169418695587792 + - 0.010169418695587792 - - 77 - - 0.011913417161825451 + - 0.009913417161825451 - - 78 - - 0.011651395309775837 + - 0.009651395309775837 - - 79 - - 0.011384177557124247 + - 0.009384177557124247 - - 80 - - 0.011112604669781574 + - 0.009112604669781574 - - 81 - - 0.010837531116523686 + - 0.008837531116523686 - - 82 - - 0.01055982238051654 + - 0.00855982238051654 - - 83 - - 0.010280352236185957 + - 0.008280352236185957 - - 84 - - 0.010000000000000002 + - 0.008000000000000002 - - 85 - - 0.009719647763814045 + - 0.007719647763814045 - - 86 - - 0.009440177619483462 + - 0.007440177619483462 - - 87 - - 0.009162468883476316 + - 0.007162468883476316 - - 88 - - 0.008887395330218428 + - 0.006887395330218429 - - 89 - - 0.008615822442875756 + - 0.006615822442875756 - - 90 - - 0.008348604690224165 + - 0.006348604690224166 - - 91 - - 0.00808658283817455 + - 0.00608658283817455 - - 92 - - 0.00783058130441221 + - 0.00583058130441221 - - 93 - - 0.0075814055644738 + - 0.0055814055644738 - - 94 - - 0.007339839617423318 + - 0.005339839617423318 - - 95 - - 0.007106643519100974 + - 0.005106643519100974 - - 96 - - 0.006882550990706333 + - 0.004882550990706333 - - 97 - - 0.006668267110239979 + - 0.004668267110239979 - - 98 - - 0.006464466094067263 + - 0.004464466094067263 - - 99 - - 0.006271789175584174 + - 0.004271789175584174 - - 100 - - 0.006090842587659851 + - 0.004090842587659851 - - 101 - - 0.0059221956552036985 + - 0.0039221956552036984 - - 102 - - 0.00576637900385858 + - 0.0037663790038585804 - - 103 - - 0.005623882890456233 + - 0.003623882890456233 - - 104 - - 0.005495155660487905 + - 0.0034951556604879046 - - 105 - - 0.005380602337443568 + - 0.003380602337443568 - - 106 - - 0.005280583348458163 + - 0.0032805833484581626 - - 107 - - 0.005195413390274502 + - 0.003195413390274502 - - 108 - - 0.005125360439090882 + - 0.0031253604390908823 - - 109 - - 0.005070644907408821 + - 0.003070644907408821 - - 110 - - 0.005031438950533787 + - 0.003031438950533787 - - 111 - - 0.005007865924910917 + - 0.003007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.013443725935320523 + noise: 0.029541906819651888 proportion: 0.16 targets: leHavre_fra: - noise: 0.030270714085038748 + noise: 0.027174439537617754 proportion: 0.18755329471737509 montreal_can: - noise: 0.013320576022818739 + noise: 0.00980727387825093 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07689493882565487 + noise: 0.0027637832634372895 proportion: 0.47933778254893905 pusan_kor: - noise: 0.007972433806655532 + noise: 0.014430384061284766 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.007497817787595211 + noise: 0.006930094460708154 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.007633866843340292 + noise: 0.008742270235780183 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0010106861866602764 + noise: 0.0011347602771777819 proportion: 0.005882857005910926 yantian_chn: - noise: 0.012219624836344655 + noise: 0.006193414953469088 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019530280872261515 + noise: 0.0012369701713498126 proportion: 0.01 targets: qingdao_chn: - noise: 0.0034939030178053614 + noise: 0.012364772365962309 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04233393468254242 + noise: 0.00352215419270645 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.021838198102471493 + noise: 0.028599483759999704 proportion: 0.24812321657873454 yantian_chn: - noise: 0.046242815176850596 + noise: 0.04900330203859365 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019129579921117862 + noise: 0.0009621506996928753 proportion: 0.01 targets: qingdao_chn: - noise: 0.012228512488579733 + noise: 0.026090492586688295 proportion: 0.19992517767067194 santos_bra: - noise: 0.028078880905400762 + noise: 0.012641742172183024 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.023876351340743802 + noise: 0.03176028945781009 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.029319437252031597 + noise: 0.009817528692331708 proportion: 0.19775168293424744 yantian_chn: - noise: 0.01928917747193642 + noise: 0.009621093160930289 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.00350760127602979 + noise: 0.0018886517487191057 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.032528716547168546 + noise: 0.004315181577345305 proportion: 0.2613085269688243 montreal_can: - noise: 0.014821251534050164 + noise: 0.016843903962712903 proportion: 0.09474419644790176 newYork_usa: - noise: 0.02447312721184167 + noise: 0.009488796573182388 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0043063159539580825 + noise: 0.016473206464419552 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0061997544295394206 + noise: 0.016694752769885985 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.0014225749496497644 + noise: 0.01034247956021821 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0049886669336311005 + noise: 0.0017025555020105283 proportion: 0.07609945087001035 yantian_chn: - noise: 0.010202155612950937 + noise: 0.012420348270095348 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007116233975121642 + noise: 0.0010398317467610486 proportion: 0.05 targets: oakland_usa: - noise: 0.021750420577675664 + noise: 0.046610961242872055 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.007223156875444034 + noise: 0.0034681253869941176 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.008409198610215574 + noise: 0.021860225648515103 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04468140938124822 + noise: 0.04086143525071624 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.022579209428659604 + noise: 0.003862724565463262 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.001237859415806274 + noise: 0.0076983570213705055 proportion: 0.05 targets: manzanillo_mex: - noise: 0.004468190881652269 + noise: 0.0046065639504877355 proportion: 0.1642819028757581 pusan_kor: - noise: 0.015630343651636142 + noise: 0.0025188189984588993 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.01705599320218467 + noise: 0.007167172404922409 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.002949720393204809 + noise: 0.004215477057755458 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0062556847598889565 + noise: 0.0015807008466467236 proportion: 0.11985637174894495 yantian_chn: - noise: 0.017417960137127892 + noise: 0.004717980724301031 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027064881430223564 + noise: 0.027332270387564594 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0022241630073084333 + noise: 0.00041927575320429856 proportion: 0.015 targets: singapore_sgp: - noise: 0.04113598506120082 + noise: 0.01720316773737656 proportion: 0.3293364398135728 sydney_aus: - noise: 0.05585356106243802 + noise: 0.0317483357682384 proportion: 0.3364188275147848 yantian_chn: - noise: 0.04970952158933521 + noise: 6.275255136458467e-05 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0023396017313775798 + noise: 0.0001058824653549524 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.029006641730691472 + noise: 0.08372460982561138 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.052743138595601397 + noise: 0.005206377376346192 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0029698121952597563 + noise: 0.0023971524264589056 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.002300273308223476 + noise: 0.10416372800484693 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.026329645545883667 + noise: 0.05774414602239579 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00034658625196087867 + noise: 0.005226544429947875 proportion: 0.03 targets: losAngeles_usa: - noise: 0.03805042564171647 + noise: 0.054178562561998066 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.026783528316198884 + noise: 0.044477996162498444 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.02520719401293405 + noise: 0.03359401622082758 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.011450474320078908 + noise: 0.04268416733729023 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027574439469690735 + noise: 0.0029718257861642474 proportion: 0.015 targets: losAngeles_usa: - noise: 0.030666144891490648 + noise: 0.008826102450863998 proportion: 0.2657898185062753 oakland_usa: - noise: 0.05069695864471698 + noise: 0.0011354503888720232 proportion: 0.26818216862044597 qingdao_chn: - noise: 1.5150697900596916e-05 + noise: 0.014679852245526353 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.005507254948856576 + noise: 0.044867678747918735 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.003886006717160586 + noise: 0.002973353584364918 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.027386818215617247 + noise: 0.015482405581896957 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.011340855749132506 + noise: 0.0001302647468009758 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.0015411008699796073 + noise: 0.010572876890368834 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0011819920685648456 + noise: 0.0025256790825975454 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.005415688613917366 + noise: 0.0010682303655455128 proportion: 0.035795894860646466 seattle_usa: - noise: 0.012679066272107449 + noise: 0.009613260507944536 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.004046325432066565 + noise: 0.0078571916664256 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.004754201755016008 + noise: 0.0034843695558064575 proportion: 0.04038858042581788 vancouver_can: - noise: 0.010845469930487786 + noise: 0.00964564143149089 proportion: 0.059258114284493034 yantian_chn: - noise: 0.009847287555290789 + noise: 0.006902002888592339 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.016857865956875252 + noise: 0.011337884438636026 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0013405281331279736 + noise: 0.010033077426210528 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.017720647298623885 + noise: 0.02614017182248326 proportion: 0.19166868266386958 durban_sau: - noise: 0.004430489262425184 + noise: 0.0017387242678691362 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0029551319318284 + noise: 0.0003486452742150132 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.00884618941305856 + noise: 0.009182092408099281 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.008287055306659491 + noise: 0.022644078007304263 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.010416910937371144 + noise: 0.0076428490407138075 proportion: 0.061252276599797005 oakland_usa: - noise: 0.030726016025509867 + noise: 0.00338044200189517 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.001029469211236195 + noise: 0.0005795702643972235 proportion: 0.005409393840032325 pusan_kor: - noise: 0.00253441394213481 + noise: 0.0034591090510660938 proportion: 0.018577689927305203 santos_bra: - noise: 0.0012007740198499907 + noise: 0.0019028622663675436 proportion: 0.02037439104592543 seattle_usa: - noise: 0.015740512852146334 + noise: 0.0022840751022966794 proportion: 0.113038562331156 shanghai_chn: - noise: 0.001828465916657425 + noise: 0.0013813896490110294 proportion: 0.010504586083902057 vancouver_can: - noise: 0.000962793819981486 + noise: 0.0014244818796804444 proportion: 0.02008850220677704 yantian_chn: - noise: 0.001870686969127809 + noise: 0.0026191834198310256 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.020726812866609105 + noise: 0.003894234191508894 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.00046662157321829305 + noise: 0.0012134052104793088 proportion: 0.01 targets: manzanillo_mex: - noise: 0.0335790014316909 + noise: 0.012532297887460412 proportion: 0.1695702560614863 pusan_kor: - noise: 0.019876836766735944 + noise: 0.01302248526372375 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.021055304334577304 + noise: 0.005397619577307389 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.010351683215713024 + noise: 0.01679312314459858 proportion: 0.16105317774270345 yantian_chn: - noise: 0.020655951601841832 + noise: 0.019729642431771596 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.009059407942596073 + noise: 0.0055375795509528414 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003480997833509656 + noise: 0.001877414087116521 proportion: 0.01 targets: itagual_bra: - noise: 0.020657961926928516 + noise: 0.032004242821693965 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.013072578761377065 + noise: 0.02033932536567358 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.027172218926956353 + noise: 0.03140598123730028 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.028255176146783356 + noise: 0.01821241418824103 proportion: 0.19775168256638195 yantian_chn: - noise: 0.02522960406069968 + noise: 0.0026235148173812395 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.0007339846715492771 + noise: 0.003107859253019168 proportion: 0.07 targets: losAngeles_usa: - noise: 0.005803300102787883 + noise: 0.05753073850487432 proportion: 0.2912736754142012 pusan_kor: - noise: 0.011767093399526167 + noise: 0.0016502073135337876 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.01342850609637382 + noise: 0.011314497001275887 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.02208223845904732 + noise: 0.005508132238408478 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.01317084017907106 + noise: 0.019332283176789165 proportion: 0.09977785851511455 vancouver_can: - noise: 0.0032415669173149184 + noise: 0.006127488353504421 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01697269521746073 + noise: 0.01754766809268637 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.014530243985042664 + noise: 0.017095220699748878 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.02131285237332896 + noise: 0.041084325927985985 proportion: 0.21398371679064213 durban_sau: - noise: 0.002948998809093681 + noise: 0.0021696529552618954 proportion: 0.017462167174606275 itagual_bra: - noise: 0.001713993122608175 + noise: 0.0008030025073271739 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009800848688656188 + noise: 0.0015848506299856926 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.0050873385069792705 + noise: 0.00755174044562672 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.004983219928480878 + noise: 0.011854629177267675 proportion: 0.05976808154382374 oakland_usa: - noise: 0.021596249916838263 + noise: 0.028784906675318727 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0014764151425764754 + noise: 0.0017948328245855443 proportion: 0.00930596400725694 qingdao_chn: - noise: 2.741759926803036e-05 + noise: 0.000182985585552497 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0003052926172722117 + noise: 0.0007693144229259965 proportion: 0.011430536346128936 seattle_usa: - noise: 0.01952308695587358 + noise: 0.015979262018439678 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0019949337867570943 + noise: 0.0006937704178989623 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0005520948508266831 + noise: 0.0012210056169907513 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.015187739134572683 + noise: 0.010669005317136996 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.005693120029153821 + noise: 0.0012836259212510967 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.020122388762735893 + noise: 0.02731130789420123 proportion: 0.16163465526933787 durban_sau: - noise: 0.0019491514734383516 + noise: 0.0079917530205346 proportion: 0.052947229587582224 itagual_bra: - noise: 0.0002586292721110565 + noise: 0.007301258651251609 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.004984389187243039 + noise: 0.0022920930271172033 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.0015861611856993322 + noise: 0.000927122980718493 proportion: 0.054598902525719965 pusan_kor: - noise: 0.006025000972759821 + noise: 0.001481325232631238 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0004286935806667211 + noise: 0.0035672054884738702 proportion: 0.04380756610509279 santos_bra: - noise: 0.003416715058071535 + noise: 0.0072911626019552455 proportion: 0.0496114180206766 seattle_usa: - noise: 0.007700381604340727 + noise: 0.021977682321328896 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.003544364668028845 + noise: 0.006000301686369274 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.002802086921079384 + noise: 0.005118668874191572 proportion: 0.03556597867096123 sydney_aus: - noise: 0.010185014617976348 + noise: 0.0014991769548569809 proportion: 0.053961624659387086 vancouver_can: - noise: 0.002789491330076127 + noise: 0.008355987327740363 proportion: 0.04942443509903704 yantian_chn: - noise: 0.005000384119150195 + noise: 0.00424493151411591 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.008577499395403343 + noise: 0.023481573062834743 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002150752663893203 + noise: 0.002155120895930923 proportion: 0.015 targets: melbourne_aus: - noise: 0.05922344082123652 + noise: 0.043272556095345846 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.05193975256137971 + noise: 0.021150293369866142 proportion: 0.3291642505650358 yantian_chn: - noise: 0.061788693147246415 + noise: 0.032126637177988214 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002068294648050253 + noise: 0.0017361691924081258 proportion: 0.02 targets: pusan_kor: - noise: 0.016845200307234364 + noise: 0.030070192002213465 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.014999981061310954 + noise: 0.0007756258463724296 proportion: 0.16078294599848347 seattle_usa: - noise: 0.01896644075283542 + noise: 0.034787830472740866 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.0077549932712456865 + noise: 0.028936107345725295 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.02055123864749911 + noise: 0.009484290050201566 proportion: 0.15641751563334233 yantian_chn: - noise: 0.03050803433828264 + noise: 0.0057514035358065966 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.002609757843993272 + noise: 0.008422256646885302 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.025222997739158936 + noise: 0.011723548393014914 proportion: 0.23063506921338092 durban_sau: - noise: 0.0018608540738386267 + noise: 0.007028309982650573 proportion: 0.036977112629701755 itagual_bra: - noise: 0.004923606222292092 + noise: 0.0021232511744929236 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.012389321950936184 + noise: 0.01244233221440464 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.003548726911160303 + noise: 0.005219875180760516 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.000882486825036804 + noise: 0.00325693140987167 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0005349297708399651 + noise: 0.0020033324939384353 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0007216029643777133 + noise: 0.0024288519568081467 proportion: 0.020692152164438926 santos_bra: - noise: 0.0008948241044821844 + noise: 0.005917956078164042 proportion: 0.03103337095193521 seattle_usa: - noise: 0.006808164648780424 + noise: 0.008224490506305046 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0019668709850992473 + noise: 0.0012713160693603898 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0008244631028521047 + noise: 0.0005993163297166358 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003274678869997879 + noise: 0.003553789802863408 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0003213862877618055 + noise: 0.005818365387463014 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0026076979418575303 + noise: 0.000937390505729158 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.026806722998433646 + noise: 0.0075575175422493215 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.011506949353344573 + noise: 0.0008778537933683098 proportion: 0.08 targets: manzanillo_mex: - noise: 0.042678902760188174 + noise: 0.011810938798409994 proportion: 0.224773870587767 pusan_kor: - noise: 0.02092931566180752 + noise: 0.022595884352223653 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.012790853044052902 + noise: 0.024907581311612293 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.00713764692173517 + noise: 0.008287924815679014 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.018867879170398616 + noise: 0.0066037712087852 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.014299288167726593 + noise: 0.016272909688446892 proportion: 0.1115894561579222 yantian_chn: - noise: 0.010558592890221315 + noise: 0.020166976986305943 proportion: 0.14697441091807414 routes: a3s: @@ -1169,7 +1169,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 386 + capacity: 928 parking: duration: 1 noise: 1 @@ -1180,7 +1180,7 @@ vessels: noise: 1 speed: 10 a3s_vessel_001: - capacity: 386 + capacity: 928 parking: duration: 1 noise: 1 @@ -1188,10 +1188,10 @@ vessels: initial_port_name: sydney_aus route_name: a3s sailing: - noise: 1 + noise: 2 speed: 10 asa_vessel_000: - capacity: 218 + capacity: 525 parking: duration: 1 noise: 1 @@ -1199,10 +1199,10 @@ vessels: initial_port_name: singapore_sgp route_name: asa sailing: - noise: 2 + noise: 1 speed: 10 asa_vessel_001: - capacity: 218 + capacity: 525 parking: duration: 1 noise: 1 @@ -1213,7 +1213,7 @@ vessels: noise: 1 speed: 10 ate1_vessel_000: - capacity: 2303 + capacity: 5528 parking: duration: 1 noise: 1 @@ -1224,7 +1224,7 @@ vessels: noise: 2 speed: 10 ate1_vessel_001: - capacity: 2303 + capacity: 5528 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 10 gex1_vessel_000: - capacity: 459 + capacity: 1101 parking: duration: 1 noise: 1 @@ -1243,10 +1243,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: gex1 sailing: - noise: 1 + noise: 2 speed: 10 gex1_vessel_001: - capacity: 459 + capacity: 1101 parking: duration: 1 noise: 1 @@ -1254,10 +1254,10 @@ vessels: initial_port_name: montreal_can route_name: gex1 sailing: - noise: 1 + noise: 2 speed: 10 ktx5_vessel_000: - capacity: 566 + capacity: 1359 parking: duration: 1 noise: 1 @@ -1265,10 +1265,10 @@ vessels: initial_port_name: singapore_sgp route_name: ktx5 sailing: - noise: 1 + noise: 2 speed: 10 ktx5_vessel_001: - capacity: 566 + capacity: 1359 parking: duration: 1 noise: 1 @@ -1279,7 +1279,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_000: - capacity: 2641 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1287,10 +1287,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_001: - capacity: 2641 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_002: - capacity: 2641 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1309,10 +1309,10 @@ vessels: initial_port_name: singapore_sgp route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_003: - capacity: 2641 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 10 ll4_vessel_004: - capacity: 2641 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1334,7 +1334,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_005: - capacity: 2641 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1342,10 +1342,10 @@ vessels: initial_port_name: qingdao_chn route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 pcc1_vessel_000: - capacity: 1969 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 10 pcc1_vessel_001: - capacity: 1969 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1367,7 +1367,7 @@ vessels: noise: 1 speed: 10 pcc1_vessel_002: - capacity: 1969 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1375,10 +1375,10 @@ vessels: initial_port_name: princeRupert_can route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 10 pcc2_vessel_000: - capacity: 977 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1386,10 +1386,10 @@ vessels: initial_port_name: seattle_usa route_name: pcc2 sailing: - noise: 2 + noise: 1 speed: 10 pcc2_vessel_001: - capacity: 977 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 10 pcc2_vessel_002: - capacity: 977 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 851 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1419,10 +1419,10 @@ vessels: initial_port_name: seattle_usa route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 10 pnw1_vessel_001: - capacity: 851 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 10 pnw1_vessel_002: - capacity: 851 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1441,10 +1441,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_000: - capacity: 358 + capacity: 861 parking: duration: 1 noise: 1 @@ -1455,7 +1455,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_001: - capacity: 358 + capacity: 861 parking: duration: 1 noise: 1 @@ -1463,10 +1463,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_002: - capacity: 358 + capacity: 861 parking: duration: 1 noise: 1 @@ -1474,10 +1474,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_003: - capacity: 358 + capacity: 861 parking: duration: 1 noise: 1 @@ -1485,10 +1485,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_004: - capacity: 358 + capacity: 861 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_000: - capacity: 258 + capacity: 621 parking: duration: 1 noise: 1 @@ -1507,10 +1507,10 @@ vessels: initial_port_name: yantian_chn route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 saf3_vessel_001: - capacity: 258 + capacity: 621 parking: duration: 1 noise: 1 @@ -1518,10 +1518,10 @@ vessels: initial_port_name: qingdao_chn route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 saf3_vessel_002: - capacity: 258 + capacity: 621 parking: duration: 1 noise: 1 @@ -1529,10 +1529,10 @@ vessels: initial_port_name: singapore_sgp route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 saf3_vessel_003: - capacity: 258 + capacity: 621 parking: duration: 1 noise: 1 @@ -1540,10 +1540,10 @@ vessels: initial_port_name: durban_sau route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_000: - capacity: 474 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1554,7 +1554,7 @@ vessels: noise: 2 speed: 10 tla2_vessel_001: - capacity: 474 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1565,7 +1565,7 @@ vessels: noise: 2 speed: 10 tla2_vessel_002: - capacity: 474 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1576,7 +1576,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_003: - capacity: 474 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1584,10 +1584,10 @@ vessels: initial_port_name: shanghai_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_004: - capacity: 474 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1598,7 +1598,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_005: - capacity: 474 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1606,10 +1606,10 @@ vessels: initial_port_name: yantian_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tlp1_vessel_000: - capacity: 2533 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_001: - capacity: 2533 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1631,7 +1631,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_002: - capacity: 2533 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 2533 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_004: - capacity: 2533 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1661,10 +1661,10 @@ vessels: initial_port_name: sanAntonio_par route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 10 tlp1_vessel_005: - capacity: 2533 + capacity: 6079 parking: duration: 1 noise: 1 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml index 615a54bd2..2558505e9 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml @@ -2,229 +2,229 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.005 + - 0.003 - - 1 - - 0.005007865924910917 + - 0.003007865924910917 - - 2 - - 0.005031438950533787 + - 0.003031438950533787 - - 3 - - 0.005070644907408821 + - 0.003070644907408821 - - 4 - - 0.005125360439090882 + - 0.0031253604390908823 - - 5 - - 0.005195413390274502 + - 0.003195413390274502 - - 6 - - 0.005280583348458163 + - 0.0032805833484581626 - - 7 - - 0.005380602337443566 + - 0.003380602337443566 - - 8 - - 0.005495155660487905 + - 0.0034951556604879046 - - 9 - - 0.0056238828904562315 + - 0.0036238828904562315 - - 10 - - 0.0057663790038585796 + - 0.0037663790038585795 - - 11 - - 0.005922195655203699 + - 0.003922195655203699 - - 12 - - 0.006090842587659851 + - 0.004090842587659851 - - 13 - - 0.006271789175584172 + - 0.004271789175584172 - - 14 - - 0.006464466094067262 + - 0.004464466094067262 - - 15 - - 0.006668267110239981 + - 0.004668267110239981 - - 16 - - 0.006882550990706332 + - 0.004882550990706332 - - 17 - - 0.007106643519100972 + - 0.0051066435191009715 - - 18 - - 0.007339839617423317 + - 0.005339839617423317 - - 19 - - 0.007581405564473801 + - 0.005581405564473801 - - 20 - - 0.007830581304412209 + - 0.005830581304412209 - - 21 - - 0.00808658283817455 + - 0.006086582838174551 - - 22 - - 0.008348604690224165 + - 0.006348604690224164 - - 23 - - 0.008615822442875754 + - 0.006615822442875753 - - 24 - - 0.008887395330218428 + - 0.006887395330218428 - - 25 - - 0.009162468883476318 + - 0.007162468883476318 - - 26 - - 0.00944017761948346 + - 0.00744017761948346 - - 27 - - 0.009719647763814041 + - 0.007719647763814041 - - 28 - - 0.01 + - 0.008 - - 29 - - 0.01028035223618596 + - 0.00828035223618596 - - 30 - - 0.010559822380516538 + - 0.00855982238051654 - - 31 - - 0.010837531116523682 + - 0.008837531116523682 - - 32 - - 0.011112604669781572 + - 0.009112604669781572 - - 33 - - 0.011384177557124247 + - 0.009384177557124247 - - 34 - - 0.011651395309775834 + - 0.009651395309775834 - - 35 - - 0.011913417161825448 + - 0.00991341716182545 - - 36 - - 0.01216941869558779 + - 0.01016941869558779 - - 37 - - 0.0124185944355262 + - 0.010418594435526198 - - 38 - - 0.012660160382576682 + - 0.010660160382576682 - - 39 - - 0.012893356480899029 + - 0.010893356480899029 - - 40 - - 0.013117449009293668 + - 0.011117449009293668 - - 41 - - 0.01333173288976002 + - 0.01133173288976002 - - 42 - - 0.013535533905932737 + - 0.011535533905932737 - - 43 - - 0.013728210824415828 + - 0.011728210824415828 - - 44 - - 0.01390915741234015 + - 0.011909157412340148 - - 45 - - 0.014077804344796302 + - 0.0120778043447963 - - 46 - - 0.014233620996141422 + - 0.01223362099614142 - - 47 - - 0.014376117109543769 + - 0.012376117109543769 - - 48 - - 0.014504844339512095 + - 0.012504844339512097 - - 49 - - 0.014619397662556434 + - 0.012619397662556434 - - 50 - - 0.014719416651541837 + - 0.012719416651541839 - - 51 - - 0.014804586609725497 + - 0.012804586609725499 - - 52 - - 0.014874639560909118 + - 0.012874639560909118 - - 53 - - 0.01492935509259118 + - 0.01292935509259118 - - 54 - - 0.014968561049466214 + - 0.012968561049466212 - - 55 - - 0.014992134075089083 + - 0.012992134075089083 - - 56 - - 0.015 + - 0.013000000000000001 - - 57 - - 0.014992134075089083 + - 0.012992134075089083 - - 58 - - 0.014968561049466212 + - 0.012968561049466212 - - 59 - - 0.01492935509259118 + - 0.01292935509259118 - - 60 - - 0.014874639560909118 + - 0.012874639560909118 - - 61 - - 0.014804586609725499 + - 0.012804586609725499 - - 62 - - 0.014719416651541837 + - 0.012719416651541839 - - 63 - - 0.014619397662556434 + - 0.012619397662556434 - - 64 - - 0.014504844339512095 + - 0.012504844339512097 - - 65 - - 0.014376117109543767 + - 0.012376117109543769 - - 66 - - 0.014233620996141422 + - 0.012233620996141422 - - 67 - - 0.014077804344796302 + - 0.012077804344796302 - - 68 - - 0.01390915741234015 + - 0.011909157412340152 - - 69 - - 0.013728210824415828 + - 0.011728210824415828 - - 70 - - 0.01353553390593274 + - 0.01153553390593274 - - 71 - - 0.01333173288976002 + - 0.01133173288976002 - - 72 - - 0.01311744900929367 + - 0.011117449009293668 - - 73 - - 0.012893356480899027 + - 0.010893356480899029 - - 74 - - 0.012660160382576684 + - 0.010660160382576684 - - 75 - - 0.012418594435526202 + - 0.010418594435526202 - - 76 - - 0.012169418695587792 + - 0.010169418695587792 - - 77 - - 0.011913417161825451 + - 0.009913417161825451 - - 78 - - 0.011651395309775837 + - 0.009651395309775837 - - 79 - - 0.011384177557124247 + - 0.009384177557124247 - - 80 - - 0.011112604669781574 + - 0.009112604669781574 - - 81 - - 0.010837531116523686 + - 0.008837531116523686 - - 82 - - 0.01055982238051654 + - 0.00855982238051654 - - 83 - - 0.010280352236185957 + - 0.008280352236185957 - - 84 - - 0.010000000000000002 + - 0.008000000000000002 - - 85 - - 0.009719647763814045 + - 0.007719647763814045 - - 86 - - 0.009440177619483462 + - 0.007440177619483462 - - 87 - - 0.009162468883476316 + - 0.007162468883476316 - - 88 - - 0.008887395330218428 + - 0.006887395330218429 - - 89 - - 0.008615822442875756 + - 0.006615822442875756 - - 90 - - 0.008348604690224165 + - 0.006348604690224166 - - 91 - - 0.00808658283817455 + - 0.00608658283817455 - - 92 - - 0.00783058130441221 + - 0.00583058130441221 - - 93 - - 0.0075814055644738 + - 0.0055814055644738 - - 94 - - 0.007339839617423318 + - 0.005339839617423318 - - 95 - - 0.007106643519100974 + - 0.005106643519100974 - - 96 - - 0.006882550990706333 + - 0.004882550990706333 - - 97 - - 0.006668267110239979 + - 0.004668267110239979 - - 98 - - 0.006464466094067263 + - 0.004464466094067263 - - 99 - - 0.006271789175584174 + - 0.004271789175584174 - - 100 - - 0.006090842587659851 + - 0.004090842587659851 - - 101 - - 0.0059221956552036985 + - 0.0039221956552036984 - - 102 - - 0.00576637900385858 + - 0.0037663790038585804 - - 103 - - 0.005623882890456233 + - 0.003623882890456233 - - 104 - - 0.005495155660487905 + - 0.0034951556604879046 - - 105 - - 0.005380602337443568 + - 0.003380602337443568 - - 106 - - 0.005280583348458163 + - 0.0032805833484581626 - - 107 - - 0.005195413390274502 + - 0.003195413390274502 - - 108 - - 0.005125360439090882 + - 0.0031253604390908823 - - 109 - - 0.005070644907408821 + - 0.003070644907408821 - - 110 - - 0.005031438950533787 + - 0.003031438950533787 - - 111 - - 0.005007865924910917 + - 0.003007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.013443725935320523 + noise: 0.029541906819651888 proportion: 0.16 targets: leHavre_fra: - noise: 0.030270714085038748 + noise: 0.027174439537617754 proportion: 0.18755329471737509 montreal_can: - noise: 0.013320576022818739 + noise: 0.00980727387825093 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07689493882565487 + noise: 0.0027637832634372895 proportion: 0.47933778254893905 pusan_kor: - noise: 0.007972433806655532 + noise: 0.014430384061284766 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.007497817787595211 + noise: 0.006930094460708154 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.007633866843340292 + noise: 0.008742270235780183 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0010106861866602764 + noise: 0.0011347602771777819 proportion: 0.005882857005910926 yantian_chn: - noise: 0.012219624836344655 + noise: 0.006193414953469088 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019530280872261515 + noise: 0.0012369701713498126 proportion: 0.01 targets: qingdao_chn: - noise: 0.0034939030178053614 + noise: 0.012364772365962309 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04233393468254242 + noise: 0.00352215419270645 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.021838198102471493 + noise: 0.028599483759999704 proportion: 0.24812321657873454 yantian_chn: - noise: 0.046242815176850596 + noise: 0.04900330203859365 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019129579921117862 + noise: 0.0009621506996928753 proportion: 0.01 targets: qingdao_chn: - noise: 0.012228512488579733 + noise: 0.026090492586688295 proportion: 0.19992517767067194 santos_bra: - noise: 0.028078880905400762 + noise: 0.012641742172183024 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.023876351340743802 + noise: 0.03176028945781009 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.029319437252031597 + noise: 0.009817528692331708 proportion: 0.19775168293424744 yantian_chn: - noise: 0.01928917747193642 + noise: 0.009621093160930289 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.00350760127602979 + noise: 0.0018886517487191057 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.032528716547168546 + noise: 0.004315181577345305 proportion: 0.2613085269688243 montreal_can: - noise: 0.014821251534050164 + noise: 0.016843903962712903 proportion: 0.09474419644790176 newYork_usa: - noise: 0.02447312721184167 + noise: 0.009488796573182388 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0043063159539580825 + noise: 0.016473206464419552 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0061997544295394206 + noise: 0.016694752769885985 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.0014225749496497644 + noise: 0.01034247956021821 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0049886669336311005 + noise: 0.0017025555020105283 proportion: 0.07609945087001035 yantian_chn: - noise: 0.010202155612950937 + noise: 0.012420348270095348 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007116233975121642 + noise: 0.0010398317467610486 proportion: 0.05 targets: oakland_usa: - noise: 0.021750420577675664 + noise: 0.046610961242872055 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.007223156875444034 + noise: 0.0034681253869941176 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.008409198610215574 + noise: 0.021860225648515103 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04468140938124822 + noise: 0.04086143525071624 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.022579209428659604 + noise: 0.003862724565463262 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.001237859415806274 + noise: 0.0076983570213705055 proportion: 0.05 targets: manzanillo_mex: - noise: 0.004468190881652269 + noise: 0.0046065639504877355 proportion: 0.1642819028757581 pusan_kor: - noise: 0.015630343651636142 + noise: 0.0025188189984588993 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.01705599320218467 + noise: 0.007167172404922409 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.002949720393204809 + noise: 0.004215477057755458 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0062556847598889565 + noise: 0.0015807008466467236 proportion: 0.11985637174894495 yantian_chn: - noise: 0.017417960137127892 + noise: 0.004717980724301031 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027064881430223564 + noise: 0.027332270387564594 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0022241630073084333 + noise: 0.00041927575320429856 proportion: 0.015 targets: singapore_sgp: - noise: 0.04113598506120082 + noise: 0.01720316773737656 proportion: 0.3293364398135728 sydney_aus: - noise: 0.05585356106243802 + noise: 0.0317483357682384 proportion: 0.3364188275147848 yantian_chn: - noise: 0.04970952158933521 + noise: 6.275255136458467e-05 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0023396017313775798 + noise: 0.0001058824653549524 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.029006641730691472 + noise: 0.08372460982561138 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.052743138595601397 + noise: 0.005206377376346192 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0029698121952597563 + noise: 0.0023971524264589056 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.002300273308223476 + noise: 0.10416372800484693 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.026329645545883667 + noise: 0.05774414602239579 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00034658625196087867 + noise: 0.005226544429947875 proportion: 0.03 targets: losAngeles_usa: - noise: 0.03805042564171647 + noise: 0.054178562561998066 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.026783528316198884 + noise: 0.044477996162498444 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.02520719401293405 + noise: 0.03359401622082758 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.011450474320078908 + noise: 0.04268416733729023 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027574439469690735 + noise: 0.0029718257861642474 proportion: 0.015 targets: losAngeles_usa: - noise: 0.030666144891490648 + noise: 0.008826102450863998 proportion: 0.2657898185062753 oakland_usa: - noise: 0.05069695864471698 + noise: 0.0011354503888720232 proportion: 0.26818216862044597 qingdao_chn: - noise: 1.5150697900596916e-05 + noise: 0.014679852245526353 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.005507254948856576 + noise: 0.044867678747918735 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.003886006717160586 + noise: 0.002973353584364918 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.027386818215617247 + noise: 0.015482405581896957 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.011340855749132506 + noise: 0.0001302647468009758 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.0015411008699796073 + noise: 0.010572876890368834 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0011819920685648456 + noise: 0.0025256790825975454 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.005415688613917366 + noise: 0.0010682303655455128 proportion: 0.035795894860646466 seattle_usa: - noise: 0.012679066272107449 + noise: 0.009613260507944536 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.004046325432066565 + noise: 0.0078571916664256 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.004754201755016008 + noise: 0.0034843695558064575 proportion: 0.04038858042581788 vancouver_can: - noise: 0.010845469930487786 + noise: 0.00964564143149089 proportion: 0.059258114284493034 yantian_chn: - noise: 0.009847287555290789 + noise: 0.006902002888592339 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.016857865956875252 + noise: 0.011337884438636026 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0013405281331279736 + noise: 0.010033077426210528 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.017720647298623885 + noise: 0.02614017182248326 proportion: 0.19166868266386958 durban_sau: - noise: 0.004430489262425184 + noise: 0.0017387242678691362 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0029551319318284 + noise: 0.0003486452742150132 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.00884618941305856 + noise: 0.009182092408099281 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.008287055306659491 + noise: 0.022644078007304263 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.010416910937371144 + noise: 0.0076428490407138075 proportion: 0.061252276599797005 oakland_usa: - noise: 0.030726016025509867 + noise: 0.00338044200189517 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.001029469211236195 + noise: 0.0005795702643972235 proportion: 0.005409393840032325 pusan_kor: - noise: 0.00253441394213481 + noise: 0.0034591090510660938 proportion: 0.018577689927305203 santos_bra: - noise: 0.0012007740198499907 + noise: 0.0019028622663675436 proportion: 0.02037439104592543 seattle_usa: - noise: 0.015740512852146334 + noise: 0.0022840751022966794 proportion: 0.113038562331156 shanghai_chn: - noise: 0.001828465916657425 + noise: 0.0013813896490110294 proportion: 0.010504586083902057 vancouver_can: - noise: 0.000962793819981486 + noise: 0.0014244818796804444 proportion: 0.02008850220677704 yantian_chn: - noise: 0.001870686969127809 + noise: 0.0026191834198310256 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.020726812866609105 + noise: 0.003894234191508894 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.00046662157321829305 + noise: 0.0012134052104793088 proportion: 0.01 targets: manzanillo_mex: - noise: 0.0335790014316909 + noise: 0.012532297887460412 proportion: 0.1695702560614863 pusan_kor: - noise: 0.019876836766735944 + noise: 0.01302248526372375 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.021055304334577304 + noise: 0.005397619577307389 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.010351683215713024 + noise: 0.01679312314459858 proportion: 0.16105317774270345 yantian_chn: - noise: 0.020655951601841832 + noise: 0.019729642431771596 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.009059407942596073 + noise: 0.0055375795509528414 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003480997833509656 + noise: 0.001877414087116521 proportion: 0.01 targets: itagual_bra: - noise: 0.020657961926928516 + noise: 0.032004242821693965 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.013072578761377065 + noise: 0.02033932536567358 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.027172218926956353 + noise: 0.03140598123730028 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.028255176146783356 + noise: 0.01821241418824103 proportion: 0.19775168256638195 yantian_chn: - noise: 0.02522960406069968 + noise: 0.0026235148173812395 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.0007339846715492771 + noise: 0.003107859253019168 proportion: 0.07 targets: losAngeles_usa: - noise: 0.005803300102787883 + noise: 0.05753073850487432 proportion: 0.2912736754142012 pusan_kor: - noise: 0.011767093399526167 + noise: 0.0016502073135337876 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.01342850609637382 + noise: 0.011314497001275887 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.02208223845904732 + noise: 0.005508132238408478 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.01317084017907106 + noise: 0.019332283176789165 proportion: 0.09977785851511455 vancouver_can: - noise: 0.0032415669173149184 + noise: 0.006127488353504421 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01697269521746073 + noise: 0.01754766809268637 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.014530243985042664 + noise: 0.017095220699748878 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.02131285237332896 + noise: 0.041084325927985985 proportion: 0.21398371679064213 durban_sau: - noise: 0.002948998809093681 + noise: 0.0021696529552618954 proportion: 0.017462167174606275 itagual_bra: - noise: 0.001713993122608175 + noise: 0.0008030025073271739 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009800848688656188 + noise: 0.0015848506299856926 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.0050873385069792705 + noise: 0.00755174044562672 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.004983219928480878 + noise: 0.011854629177267675 proportion: 0.05976808154382374 oakland_usa: - noise: 0.021596249916838263 + noise: 0.028784906675318727 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0014764151425764754 + noise: 0.0017948328245855443 proportion: 0.00930596400725694 qingdao_chn: - noise: 2.741759926803036e-05 + noise: 0.000182985585552497 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0003052926172722117 + noise: 0.0007693144229259965 proportion: 0.011430536346128936 seattle_usa: - noise: 0.01952308695587358 + noise: 0.015979262018439678 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0019949337867570943 + noise: 0.0006937704178989623 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0005520948508266831 + noise: 0.0012210056169907513 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.015187739134572683 + noise: 0.010669005317136996 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.005693120029153821 + noise: 0.0012836259212510967 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.020122388762735893 + noise: 0.02731130789420123 proportion: 0.16163465526933787 durban_sau: - noise: 0.0019491514734383516 + noise: 0.0079917530205346 proportion: 0.052947229587582224 itagual_bra: - noise: 0.0002586292721110565 + noise: 0.007301258651251609 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.004984389187243039 + noise: 0.0022920930271172033 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.0015861611856993322 + noise: 0.000927122980718493 proportion: 0.054598902525719965 pusan_kor: - noise: 0.006025000972759821 + noise: 0.001481325232631238 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0004286935806667211 + noise: 0.0035672054884738702 proportion: 0.04380756610509279 santos_bra: - noise: 0.003416715058071535 + noise: 0.0072911626019552455 proportion: 0.0496114180206766 seattle_usa: - noise: 0.007700381604340727 + noise: 0.021977682321328896 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.003544364668028845 + noise: 0.006000301686369274 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.002802086921079384 + noise: 0.005118668874191572 proportion: 0.03556597867096123 sydney_aus: - noise: 0.010185014617976348 + noise: 0.0014991769548569809 proportion: 0.053961624659387086 vancouver_can: - noise: 0.002789491330076127 + noise: 0.008355987327740363 proportion: 0.04942443509903704 yantian_chn: - noise: 0.005000384119150195 + noise: 0.00424493151411591 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.008577499395403343 + noise: 0.023481573062834743 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002150752663893203 + noise: 0.002155120895930923 proportion: 0.015 targets: melbourne_aus: - noise: 0.05922344082123652 + noise: 0.043272556095345846 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.05193975256137971 + noise: 0.021150293369866142 proportion: 0.3291642505650358 yantian_chn: - noise: 0.061788693147246415 + noise: 0.032126637177988214 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002068294648050253 + noise: 0.0017361691924081258 proportion: 0.02 targets: pusan_kor: - noise: 0.016845200307234364 + noise: 0.030070192002213465 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.014999981061310954 + noise: 0.0007756258463724296 proportion: 0.16078294599848347 seattle_usa: - noise: 0.01896644075283542 + noise: 0.034787830472740866 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.0077549932712456865 + noise: 0.028936107345725295 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.02055123864749911 + noise: 0.009484290050201566 proportion: 0.15641751563334233 yantian_chn: - noise: 0.03050803433828264 + noise: 0.0057514035358065966 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.002609757843993272 + noise: 0.008422256646885302 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.025222997739158936 + noise: 0.011723548393014914 proportion: 0.23063506921338092 durban_sau: - noise: 0.0018608540738386267 + noise: 0.007028309982650573 proportion: 0.036977112629701755 itagual_bra: - noise: 0.004923606222292092 + noise: 0.0021232511744929236 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.012389321950936184 + noise: 0.01244233221440464 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.003548726911160303 + noise: 0.005219875180760516 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.000882486825036804 + noise: 0.00325693140987167 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0005349297708399651 + noise: 0.0020033324939384353 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0007216029643777133 + noise: 0.0024288519568081467 proportion: 0.020692152164438926 santos_bra: - noise: 0.0008948241044821844 + noise: 0.005917956078164042 proportion: 0.03103337095193521 seattle_usa: - noise: 0.006808164648780424 + noise: 0.008224490506305046 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0019668709850992473 + noise: 0.0012713160693603898 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0008244631028521047 + noise: 0.0005993163297166358 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003274678869997879 + noise: 0.003553789802863408 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0003213862877618055 + noise: 0.005818365387463014 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0026076979418575303 + noise: 0.000937390505729158 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.026806722998433646 + noise: 0.0075575175422493215 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.011506949353344573 + noise: 0.0008778537933683098 proportion: 0.08 targets: manzanillo_mex: - noise: 0.042678902760188174 + noise: 0.011810938798409994 proportion: 0.224773870587767 pusan_kor: - noise: 0.02092931566180752 + noise: 0.022595884352223653 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.012790853044052902 + noise: 0.024907581311612293 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.00713764692173517 + noise: 0.008287924815679014 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.018867879170398616 + noise: 0.0066037712087852 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.014299288167726593 + noise: 0.016272909688446892 proportion: 0.1115894561579222 yantian_chn: - noise: 0.010558592890221315 + noise: 0.020166976986305943 proportion: 0.14697441091807414 routes: a3s: @@ -1169,7 +1169,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 483 + capacity: 928 parking: duration: 1 noise: 1 @@ -1180,7 +1180,7 @@ vessels: noise: 1 speed: 10 a3s_vessel_001: - capacity: 483 + capacity: 928 parking: duration: 1 noise: 1 @@ -1188,10 +1188,10 @@ vessels: initial_port_name: sydney_aus route_name: a3s sailing: - noise: 1 + noise: 2 speed: 9 asa_vessel_000: - capacity: 273 + capacity: 525 parking: duration: 1 noise: 1 @@ -1199,10 +1199,10 @@ vessels: initial_port_name: singapore_sgp route_name: asa sailing: - noise: 2 + noise: 1 speed: 8 asa_vessel_001: - capacity: 273 + capacity: 525 parking: duration: 1 noise: 1 @@ -1213,7 +1213,7 @@ vessels: noise: 1 speed: 10 ate1_vessel_000: - capacity: 2879 + capacity: 5528 parking: duration: 1 noise: 1 @@ -1224,7 +1224,7 @@ vessels: noise: 2 speed: 9 ate1_vessel_001: - capacity: 2879 + capacity: 5528 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 8 gex1_vessel_000: - capacity: 573 + capacity: 1101 parking: duration: 1 noise: 1 @@ -1243,10 +1243,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: gex1 sailing: - noise: 1 + noise: 2 speed: 10 gex1_vessel_001: - capacity: 573 + capacity: 1101 parking: duration: 1 noise: 1 @@ -1254,10 +1254,10 @@ vessels: initial_port_name: montreal_can route_name: gex1 sailing: - noise: 1 + noise: 2 speed: 9 ktx5_vessel_000: - capacity: 708 + capacity: 1359 parking: duration: 1 noise: 1 @@ -1265,10 +1265,10 @@ vessels: initial_port_name: singapore_sgp route_name: ktx5 sailing: - noise: 1 + noise: 2 speed: 8 ktx5_vessel_001: - capacity: 708 + capacity: 1359 parking: duration: 1 noise: 1 @@ -1279,7 +1279,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_000: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1287,10 +1287,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 9 ll4_vessel_001: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_002: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1309,10 +1309,10 @@ vessels: initial_port_name: singapore_sgp route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_003: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 9 ll4_vessel_004: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1334,7 +1334,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_005: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1342,10 +1342,10 @@ vessels: initial_port_name: qingdao_chn route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 pcc1_vessel_000: - capacity: 2461 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 9 pcc1_vessel_001: - capacity: 2461 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1367,7 +1367,7 @@ vessels: noise: 1 speed: 8 pcc1_vessel_002: - capacity: 2461 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1375,10 +1375,10 @@ vessels: initial_port_name: princeRupert_can route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 10 pcc2_vessel_000: - capacity: 1221 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1386,10 +1386,10 @@ vessels: initial_port_name: seattle_usa route_name: pcc2 sailing: - noise: 2 + noise: 1 speed: 9 pcc2_vessel_001: - capacity: 1221 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 8 pcc2_vessel_002: - capacity: 1221 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 1064 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1419,10 +1419,10 @@ vessels: initial_port_name: seattle_usa route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 9 pnw1_vessel_001: - capacity: 1064 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 8 pnw1_vessel_002: - capacity: 1064 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1441,10 +1441,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_000: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1455,7 +1455,7 @@ vessels: noise: 1 speed: 9 pnw2_vessel_001: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1463,10 +1463,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 8 pnw2_vessel_002: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1474,10 +1474,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_003: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1485,10 +1485,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 9 pnw2_vessel_004: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 8 saf3_vessel_000: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1507,10 +1507,10 @@ vessels: initial_port_name: yantian_chn route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 saf3_vessel_001: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1518,10 +1518,10 @@ vessels: initial_port_name: qingdao_chn route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 9 saf3_vessel_002: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1529,10 +1529,10 @@ vessels: initial_port_name: singapore_sgp route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 8 saf3_vessel_003: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1540,10 +1540,10 @@ vessels: initial_port_name: durban_sau route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_000: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1554,7 +1554,7 @@ vessels: noise: 2 speed: 9 tla2_vessel_001: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1565,7 +1565,7 @@ vessels: noise: 2 speed: 8 tla2_vessel_002: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1576,7 +1576,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_003: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1584,10 +1584,10 @@ vessels: initial_port_name: shanghai_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 9 tla2_vessel_004: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1598,7 +1598,7 @@ vessels: noise: 1 speed: 8 tla2_vessel_005: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1606,10 +1606,10 @@ vessels: initial_port_name: yantian_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tlp1_vessel_000: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_001: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1631,7 +1631,7 @@ vessels: noise: 2 speed: 8 tlp1_vessel_002: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_004: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1661,10 +1661,10 @@ vessels: initial_port_name: sanAntonio_par route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 8 tlp1_vessel_005: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml index 4378bc2d2..524d0fc82 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml @@ -2,229 +2,229 @@ container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.005 + - 0.003 - - 1 - - 0.005012045981107781 + - 0.0030120459811077806 - - 2 - - 0.00504449361596974 + - 0.0030444936159697397 - - 3 - - 0.005086758870970731 + - 0.003086758870970731 - - 4 - - 0.0051227749415306695 + - 0.00312277494153067 - - 5 - - 0.005133182625055171 + - 0.003133182625055171 - - 6 - - 0.00509807371913584 + - 0.0030980737191358397 - - 7 - - 0.005 + - 0.003 - - 8 - - 0.005173074266317172 + - 0.003173074266317172 - - 9 - - 0.005425203006617148 + - 0.0034252030066171473 - - 10 - - 0.005750572812854111 + - 0.003750572812854111 - - 11 - - 0.006132546658976814 + - 0.004132546658976814 - - 12 - - 0.006543802523771078 + - 0.004543802523771078 - - 13 - - 0.0069476347099251025 + - 0.0049476347099251024 - - 14 - - 0.007300377961276525 + - 0.005300377961276525 - - 15 - - 0.007554806245962416 + - 0.005554806245962416 - - 16 - - 0.00766425880641032 + - 0.00566425880641032 - - 17 - - 0.007587164736409392 + - 0.005587164736409392 - - 18 - - 0.0072915815731311225 + - 0.0052915815731311225 - - 19 - - 0.006759338850452894 + - 0.004759338850452894 - - 20 - - 0.005989387422188653 + - 0.003989387422188653 - - 21 - - 0.005000000000000001 + - 0.003000000000000001 - - 22 - - 0.006170454760379227 + - 0.004170454760379227 - - 23 - - 0.0074643384161091845 + - 0.005464338416109183 - - 24 - - 0.008807219708509131 + - 0.006807219708509132 - - 25 - - 0.010111919797577836 + - 0.008111919797577836 - - 26 - - 0.011283910705811102 + - 0.009283910705811102 - - 27 - - 0.012227730806249693 + - 0.010227730806249693 - - 28 - - 0.012853981633974484 + - 0.010853981633974483 - - 29 - - 0.013086401027200566 + - 0.011086401027200567 - - 30 - - 0.012868475176765658 + - 0.01086847517676566 - - 31 - - 0.012169060410756063 + - 0.010169060410756062 - - 32 - - 0.010986535197028633 + - 0.008986535197028633 - - 33 - - 0.009351091420509772 + - 0.007351091420509771 - - 34 - - 0.007324895896556256 + - 0.005324895896556256 - - 35 - - 0.005000000000000001 + - 0.003000000000000001 - - 36 - - 0.007505963234746832 + - 0.005505963234746832 - - 37 - - 0.01005609098616606 + - 0.00805609098616606 - - 38 - - 0.012502173332406642 + - 0.01050217333240664 - - 39 - - 0.014693815471924509 + - 0.012693815471924507 - - 40 - - 0.016488127076166443 + - 0.014488127076166445 - - 41 - - 0.017759325587487846 + - 0.015759325587487844 - - 42 - - 0.018407585306672438 + - 0.01640758530667244 - - 43 - - 0.018366497123525158 + - 0.016366497123525156 - - 44 - - 0.017608583358805684 + - 0.015608583358805685 - - 45 - - 0.016148433549357088 + - 0.01414843354935709 - - 46 - - 0.014043182092683657 + - 0.012043182092683655 - - 47 - - 0.01139022683000181 + - 0.009390226830001812 - - 48 - - 0.008322276390618315 + - 0.006322276390618315 - - 49 - - 0.005000000000000003 + - 0.0030000000000000027 - - 50 - - 0.008397276937799642 + - 0.006397276937799643 - - 51 - - 0.01168224721156378 + - 0.009682247211563782 - - 52 - - 0.014670979964007094 + - 0.012670979964007095 - - 53 - - 0.017194221337363164 + - 0.015194221337363166 - - 54 - - 0.019107892266607023 + - 0.01710789226660702 - - 55 - - 0.02030208585234248 + - 0.018302085852342477 - - 56 - - 0.020707963267948964 + - 0.018707963267948966 - - 57 - - 0.020302085852342482 + - 0.01830208585234248 - - 58 - - 0.019107892266607026 + - 0.017107892266607024 - - 59 - - 0.017194221337363164 + - 0.015194221337363166 - - 60 - - 0.014670979964007097 + - 0.012670979964007099 - - 61 - - 0.011682247211563787 + - 0.009682247211563787 - - 62 - - 0.008397276937799646 + - 0.0063972769377996464 - - 63 - - 0.005000000000000001 + - 0.003000000000000001 - - 64 - - 0.008322276390618312 + - 0.006322276390618312 - - 65 - - 0.011390226830001805 + - 0.009390226830001807 - - 66 - - 0.014043182092683654 + - 0.012043182092683655 - - 67 - - 0.016148433549357084 + - 0.014148433549357083 - - 68 - - 0.017608583358805684 + - 0.015608583358805689 - - 69 - - 0.018366497123525158 + - 0.016366497123525156 - - 70 - - 0.018407585306672445 + - 0.016407585306672443 - - 71 - - 0.017759325587487846 + - 0.015759325587487844 - - 72 - - 0.016488127076166446 + - 0.014488127076166445 - - 73 - - 0.014693815471924509 + - 0.012693815471924514 - - 74 - - 0.012502173332406646 + - 0.010502173332406646 - - 75 - - 0.010056090986166066 + - 0.008056090986166064 - - 76 - - 0.007505963234746836 + - 0.005505963234746836 - - 77 - - 0.005000000000000002 + - 0.0030000000000000022 - - 78 - - 0.007324895896556256 + - 0.005324895896556256 - - 79 - - 0.009351091420509768 + - 0.007351091420509768 - - 80 - - 0.010986535197028632 + - 0.008986535197028633 - - 81 - - 0.012169060410756065 + - 0.010169060410756065 - - 82 - - 0.012868475176765662 + - 0.01086847517676566 - - 83 - - 0.013086401027200562 + - 0.011086401027200564 - - 84 - - 0.012853981633974484 + - 0.010853981633974486 - - 85 - - 0.0122277308062497 + - 0.0102277308062497 - - 86 - - 0.011283910705811105 + - 0.009283910705811103 - - 87 - - 0.010111919797577834 + - 0.008111919797577832 - - 88 - - 0.008807219708509133 + - 0.006807219708509134 - - 89 - - 0.007464338416109186 + - 0.005464338416109187 - - 90 - - 0.006170454760379228 + - 0.004170454760379229 - - 91 - - 0.005 + - 0.0030000000000000005 - - 92 - - 0.005989387422188652 + - 0.003989387422188652 - - 93 - - 0.006759338850452893 + - 0.004759338850452893 - - 94 - - 0.0072915815731311225 + - 0.0052915815731311225 - - 95 - - 0.007587164736409394 + - 0.005587164736409394 - - 96 - - 0.007664258806410321 + - 0.005664258806410321 - - 97 - - 0.0075548062459624135 + - 0.0055548062459624134 - - 98 - - 0.007300377961276526 + - 0.005300377961276526 - - 99 - - 0.006947634709925106 + - 0.004947634709925106 - - 100 - - 0.006543802523771078 + - 0.004543802523771078 - - 101 - - 0.006132546658976813 + - 0.004132546658976813 - - 102 - - 0.005750572812854112 + - 0.003750572812854112 - - 103 - - 0.005425203006617149 + - 0.0034252030066171486 - - 104 - - 0.005173074266317172 + - 0.0031730742663171724 - - 105 - - 0.005 + - 0.003 - - 106 - - 0.005098073719135839 + - 0.0030980737191358397 - - 107 - - 0.005133182625055171 + - 0.003133182625055171 - - 108 - - 0.0051227749415306695 + - 0.00312277494153067 - - 109 - - 0.005086758870970731 + - 0.003086758870970731 - - 110 - - 0.00504449361596974 + - 0.0030444936159697397 - - 111 - - 0.005012045981107781 + - 0.0030120459811077806 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +241,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.013443725935320523 + noise: 0.029541906819651888 proportion: 0.16 targets: leHavre_fra: - noise: 0.030270714085038748 + noise: 0.027174439537617754 proportion: 0.18755329471737509 montreal_can: - noise: 0.013320576022818739 + noise: 0.00980727387825093 proportion: 0.0756906048807678 newYork_usa: - noise: 0.07689493882565487 + noise: 0.0027637832634372895 proportion: 0.47933778254893905 pusan_kor: - noise: 0.007972433806655532 + noise: 0.014430384061284766 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.007497817787595211 + noise: 0.006930094460708154 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.007633866843340292 + noise: 0.008742270235780183 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0010106861866602764 + noise: 0.0011347602771777819 proportion: 0.005882857005910926 yantian_chn: - noise: 0.012219624836344655 + noise: 0.006193414953469088 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +279,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019530280872261515 + noise: 0.0012369701713498126 proportion: 0.01 targets: qingdao_chn: - noise: 0.0034939030178053614 + noise: 0.012364772365962309 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.04233393468254242 + noise: 0.00352215419270645 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.021838198102471493 + noise: 0.028599483759999704 proportion: 0.24812321657873454 yantian_chn: - noise: 0.046242815176850596 + noise: 0.04900330203859365 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +305,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0019129579921117862 + noise: 0.0009621506996928753 proportion: 0.01 targets: qingdao_chn: - noise: 0.012228512488579733 + noise: 0.026090492586688295 proportion: 0.19992517767067194 santos_bra: - noise: 0.028078880905400762 + noise: 0.012641742172183024 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.023876351340743802 + noise: 0.03176028945781009 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.029319437252031597 + noise: 0.009817528692331708 proportion: 0.19775168293424744 yantian_chn: - noise: 0.01928917747193642 + noise: 0.009621093160930289 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +334,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.00350760127602979 + noise: 0.0018886517487191057 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.032528716547168546 + noise: 0.004315181577345305 proportion: 0.2613085269688243 montreal_can: - noise: 0.014821251534050164 + noise: 0.016843903962712903 proportion: 0.09474419644790176 newYork_usa: - noise: 0.02447312721184167 + noise: 0.009488796573182388 proportion: 0.20255309034522379 pusan_kor: - noise: 0.0043063159539580825 + noise: 0.016473206464419552 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.0061997544295394206 + noise: 0.016694752769885985 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.0014225749496497644 + noise: 0.01034247956021821 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0049886669336311005 + noise: 0.0017025555020105283 proportion: 0.07609945087001035 yantian_chn: - noise: 0.010202155612950937 + noise: 0.012420348270095348 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +372,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.007116233975121642 + noise: 0.0010398317467610486 proportion: 0.05 targets: oakland_usa: - noise: 0.021750420577675664 + noise: 0.046610961242872055 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.007223156875444034 + noise: 0.0034681253869941176 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.008409198610215574 + noise: 0.021860225648515103 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04468140938124822 + noise: 0.04086143525071624 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.022579209428659604 + noise: 0.003862724565463262 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +401,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.001237859415806274 + noise: 0.0076983570213705055 proportion: 0.05 targets: manzanillo_mex: - noise: 0.004468190881652269 + noise: 0.0046065639504877355 proportion: 0.1642819028757581 pusan_kor: - noise: 0.015630343651636142 + noise: 0.0025188189984588993 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.01705599320218467 + noise: 0.007167172404922409 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.002949720393204809 + noise: 0.004215477057755458 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0062556847598889565 + noise: 0.0015807008466467236 proportion: 0.11985637174894495 yantian_chn: - noise: 0.017417960137127892 + noise: 0.004717980724301031 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027064881430223564 + noise: 0.027332270387564594 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +436,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0022241630073084333 + noise: 0.00041927575320429856 proportion: 0.015 targets: singapore_sgp: - noise: 0.04113598506120082 + noise: 0.01720316773737656 proportion: 0.3293364398135728 sydney_aus: - noise: 0.05585356106243802 + noise: 0.0317483357682384 proportion: 0.3364188275147848 yantian_chn: - noise: 0.04970952158933521 + noise: 6.275255136458467e-05 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +459,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0023396017313775798 + noise: 0.0001058824653549524 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.029006641730691472 + noise: 0.08372460982561138 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.052743138595601397 + noise: 0.005206377376346192 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +479,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0029698121952597563 + noise: 0.0023971524264589056 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.002300273308223476 + noise: 0.10416372800484693 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.026329645545883667 + noise: 0.05774414602239579 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +499,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.00034658625196087867 + noise: 0.005226544429947875 proportion: 0.03 targets: losAngeles_usa: - noise: 0.03805042564171647 + noise: 0.054178562561998066 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.026783528316198884 + noise: 0.044477996162498444 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.02520719401293405 + noise: 0.03359401622082758 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.011450474320078908 + noise: 0.04268416733729023 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +525,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0027574439469690735 + noise: 0.0029718257861642474 proportion: 0.015 targets: losAngeles_usa: - noise: 0.030666144891490648 + noise: 0.008826102450863998 proportion: 0.2657898185062753 oakland_usa: - noise: 0.05069695864471698 + noise: 0.0011354503888720232 proportion: 0.26818216862044597 qingdao_chn: - noise: 1.5150697900596916e-05 + noise: 0.014679852245526353 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.005507254948856576 + noise: 0.044867678747918735 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +551,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.003886006717160586 + noise: 0.002973353584364918 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.027386818215617247 + noise: 0.015482405581896957 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.011340855749132506 + noise: 0.0001302647468009758 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.0015411008699796073 + noise: 0.010572876890368834 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0011819920685648456 + noise: 0.0025256790825975454 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.005415688613917366 + noise: 0.0010682303655455128 proportion: 0.035795894860646466 seattle_usa: - noise: 0.012679066272107449 + noise: 0.009613260507944536 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.004046325432066565 + noise: 0.0078571916664256 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.004754201755016008 + noise: 0.0034843695558064575 proportion: 0.04038858042581788 vancouver_can: - noise: 0.010845469930487786 + noise: 0.00964564143149089 proportion: 0.059258114284493034 yantian_chn: - noise: 0.009847287555290789 + noise: 0.006902002888592339 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.016857865956875252 + noise: 0.011337884438636026 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +598,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0013405281331279736 + noise: 0.010033077426210528 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.017720647298623885 + noise: 0.02614017182248326 proportion: 0.19166868266386958 durban_sau: - noise: 0.004430489262425184 + noise: 0.0017387242678691362 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0029551319318284 + noise: 0.0003486452742150132 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.00884618941305856 + noise: 0.009182092408099281 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.008287055306659491 + noise: 0.022644078007304263 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.010416910937371144 + noise: 0.0076428490407138075 proportion: 0.061252276599797005 oakland_usa: - noise: 0.030726016025509867 + noise: 0.00338044200189517 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.001029469211236195 + noise: 0.0005795702643972235 proportion: 0.005409393840032325 pusan_kor: - noise: 0.00253441394213481 + noise: 0.0034591090510660938 proportion: 0.018577689927305203 santos_bra: - noise: 0.0012007740198499907 + noise: 0.0019028622663675436 proportion: 0.02037439104592543 seattle_usa: - noise: 0.015740512852146334 + noise: 0.0022840751022966794 proportion: 0.113038562331156 shanghai_chn: - noise: 0.001828465916657425 + noise: 0.0013813896490110294 proportion: 0.010504586083902057 vancouver_can: - noise: 0.000962793819981486 + noise: 0.0014244818796804444 proportion: 0.02008850220677704 yantian_chn: - noise: 0.001870686969127809 + noise: 0.0026191834198310256 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.020726812866609105 + noise: 0.003894234191508894 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +657,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.00046662157321829305 + noise: 0.0012134052104793088 proportion: 0.01 targets: manzanillo_mex: - noise: 0.0335790014316909 + noise: 0.012532297887460412 proportion: 0.1695702560614863 pusan_kor: - noise: 0.019876836766735944 + noise: 0.01302248526372375 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.021055304334577304 + noise: 0.005397619577307389 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.010351683215713024 + noise: 0.01679312314459858 proportion: 0.16105317774270345 yantian_chn: - noise: 0.020655951601841832 + noise: 0.019729642431771596 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.009059407942596073 + noise: 0.0055375795509528414 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +689,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0003480997833509656 + noise: 0.001877414087116521 proportion: 0.01 targets: itagual_bra: - noise: 0.020657961926928516 + noise: 0.032004242821693965 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.013072578761377065 + noise: 0.02033932536567358 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.027172218926956353 + noise: 0.03140598123730028 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.028255176146783356 + noise: 0.01821241418824103 proportion: 0.19775168256638195 yantian_chn: - noise: 0.02522960406069968 + noise: 0.0026235148173812395 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +718,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.0007339846715492771 + noise: 0.003107859253019168 proportion: 0.07 targets: losAngeles_usa: - noise: 0.005803300102787883 + noise: 0.05753073850487432 proportion: 0.2912736754142012 pusan_kor: - noise: 0.011767093399526167 + noise: 0.0016502073135337876 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.01342850609637382 + noise: 0.011314497001275887 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.02208223845904732 + noise: 0.005508132238408478 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.01317084017907106 + noise: 0.019332283176789165 proportion: 0.09977785851511455 vancouver_can: - noise: 0.0032415669173149184 + noise: 0.006127488353504421 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01697269521746073 + noise: 0.01754766809268637 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +753,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.014530243985042664 + noise: 0.017095220699748878 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.02131285237332896 + noise: 0.041084325927985985 proportion: 0.21398371679064213 durban_sau: - noise: 0.002948998809093681 + noise: 0.0021696529552618954 proportion: 0.017462167174606275 itagual_bra: - noise: 0.001713993122608175 + noise: 0.0008030025073271739 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0009800848688656188 + noise: 0.0015848506299856926 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.0050873385069792705 + noise: 0.00755174044562672 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.004983219928480878 + noise: 0.011854629177267675 proportion: 0.05976808154382374 oakland_usa: - noise: 0.021596249916838263 + noise: 0.028784906675318727 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0014764151425764754 + noise: 0.0017948328245855443 proportion: 0.00930596400725694 qingdao_chn: - noise: 2.741759926803036e-05 + noise: 0.000182985585552497 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0003052926172722117 + noise: 0.0007693144229259965 proportion: 0.011430536346128936 seattle_usa: - noise: 0.01952308695587358 + noise: 0.015979262018439678 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0019949337867570943 + noise: 0.0006937704178989623 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0005520948508266831 + noise: 0.0012210056169907513 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.015187739134572683 + noise: 0.010669005317136996 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +809,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.005693120029153821 + noise: 0.0012836259212510967 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.020122388762735893 + noise: 0.02731130789420123 proportion: 0.16163465526933787 durban_sau: - noise: 0.0019491514734383516 + noise: 0.0079917530205346 proportion: 0.052947229587582224 itagual_bra: - noise: 0.0002586292721110565 + noise: 0.007301258651251609 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.004984389187243039 + noise: 0.0022920930271172033 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.0015861611856993322 + noise: 0.000927122980718493 proportion: 0.054598902525719965 pusan_kor: - noise: 0.006025000972759821 + noise: 0.001481325232631238 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0004286935806667211 + noise: 0.0035672054884738702 proportion: 0.04380756610509279 santos_bra: - noise: 0.003416715058071535 + noise: 0.0072911626019552455 proportion: 0.0496114180206766 seattle_usa: - noise: 0.007700381604340727 + noise: 0.021977682321328896 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.003544364668028845 + noise: 0.006000301686369274 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.002802086921079384 + noise: 0.005118668874191572 proportion: 0.03556597867096123 sydney_aus: - noise: 0.010185014617976348 + noise: 0.0014991769548569809 proportion: 0.053961624659387086 vancouver_can: - noise: 0.002789491330076127 + noise: 0.008355987327740363 proportion: 0.04942443509903704 yantian_chn: - noise: 0.005000384119150195 + noise: 0.00424493151411591 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.008577499395403343 + noise: 0.023481573062834743 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +868,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002150752663893203 + noise: 0.002155120895930923 proportion: 0.015 targets: melbourne_aus: - noise: 0.05922344082123652 + noise: 0.043272556095345846 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.05193975256137971 + noise: 0.021150293369866142 proportion: 0.3291642505650358 yantian_chn: - noise: 0.061788693147246415 + noise: 0.032126637177988214 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +891,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.002068294648050253 + noise: 0.0017361691924081258 proportion: 0.02 targets: pusan_kor: - noise: 0.016845200307234364 + noise: 0.030070192002213465 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.014999981061310954 + noise: 0.0007756258463724296 proportion: 0.16078294599848347 seattle_usa: - noise: 0.01896644075283542 + noise: 0.034787830472740866 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.0077549932712456865 + noise: 0.028936107345725295 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.02055123864749911 + noise: 0.009484290050201566 proportion: 0.15641751563334233 yantian_chn: - noise: 0.03050803433828264 + noise: 0.0057514035358065966 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +923,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.002609757843993272 + noise: 0.008422256646885302 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.025222997739158936 + noise: 0.011723548393014914 proportion: 0.23063506921338092 durban_sau: - noise: 0.0018608540738386267 + noise: 0.007028309982650573 proportion: 0.036977112629701755 itagual_bra: - noise: 0.004923606222292092 + noise: 0.0021232511744929236 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.012389321950936184 + noise: 0.01244233221440464 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.003548726911160303 + noise: 0.005219875180760516 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.000882486825036804 + noise: 0.00325693140987167 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0005349297708399651 + noise: 0.0020033324939384353 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0007216029643777133 + noise: 0.0024288519568081467 proportion: 0.020692152164438926 santos_bra: - noise: 0.0008948241044821844 + noise: 0.005917956078164042 proportion: 0.03103337095193521 seattle_usa: - noise: 0.006808164648780424 + noise: 0.008224490506305046 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0019668709850992473 + noise: 0.0012713160693603898 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0008244631028521047 + noise: 0.0005993163297166358 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003274678869997879 + noise: 0.003553789802863408 proportion: 0.03878455068512264 vancouver_can: - noise: 0.0003213862877618055 + noise: 0.005818365387463014 proportion: 0.03070023678474206 yantian_chn: - noise: 0.0026076979418575303 + noise: 0.000937390505729158 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.026806722998433646 + noise: 0.0075575175422493215 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +985,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.011506949353344573 + noise: 0.0008778537933683098 proportion: 0.08 targets: manzanillo_mex: - noise: 0.042678902760188174 + noise: 0.011810938798409994 proportion: 0.224773870587767 pusan_kor: - noise: 0.02092931566180752 + noise: 0.022595884352223653 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.012790853044052902 + noise: 0.024907581311612293 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.00713764692173517 + noise: 0.008287924815679014 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.018867879170398616 + noise: 0.0066037712087852 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.014299288167726593 + noise: 0.016272909688446892 proportion: 0.1115894561579222 yantian_chn: - noise: 0.010558592890221315 + noise: 0.020166976986305943 proportion: 0.14697441091807414 routes: a3s: @@ -1169,7 +1169,7 @@ transfer_cost_factors: load: 0.05 vessels: a3s_vessel_000: - capacity: 483 + capacity: 928 parking: duration: 1 noise: 1 @@ -1180,7 +1180,7 @@ vessels: noise: 1 speed: 10 a3s_vessel_001: - capacity: 483 + capacity: 928 parking: duration: 1 noise: 1 @@ -1188,10 +1188,10 @@ vessels: initial_port_name: sydney_aus route_name: a3s sailing: - noise: 1 + noise: 2 speed: 9 asa_vessel_000: - capacity: 273 + capacity: 525 parking: duration: 1 noise: 1 @@ -1199,10 +1199,10 @@ vessels: initial_port_name: singapore_sgp route_name: asa sailing: - noise: 2 + noise: 1 speed: 8 asa_vessel_001: - capacity: 273 + capacity: 525 parking: duration: 1 noise: 1 @@ -1213,7 +1213,7 @@ vessels: noise: 1 speed: 10 ate1_vessel_000: - capacity: 2879 + capacity: 5528 parking: duration: 1 noise: 1 @@ -1224,7 +1224,7 @@ vessels: noise: 2 speed: 9 ate1_vessel_001: - capacity: 2879 + capacity: 5528 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 8 gex1_vessel_000: - capacity: 573 + capacity: 1101 parking: duration: 1 noise: 1 @@ -1243,10 +1243,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: gex1 sailing: - noise: 1 + noise: 2 speed: 10 gex1_vessel_001: - capacity: 573 + capacity: 1101 parking: duration: 1 noise: 1 @@ -1254,10 +1254,10 @@ vessels: initial_port_name: montreal_can route_name: gex1 sailing: - noise: 1 + noise: 2 speed: 9 ktx5_vessel_000: - capacity: 708 + capacity: 1359 parking: duration: 1 noise: 1 @@ -1265,10 +1265,10 @@ vessels: initial_port_name: singapore_sgp route_name: ktx5 sailing: - noise: 1 + noise: 2 speed: 8 ktx5_vessel_001: - capacity: 708 + capacity: 1359 parking: duration: 1 noise: 1 @@ -1279,7 +1279,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_000: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1287,10 +1287,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 9 ll4_vessel_001: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_002: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1309,10 +1309,10 @@ vessels: initial_port_name: singapore_sgp route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_003: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 9 ll4_vessel_004: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1334,7 +1334,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_005: - capacity: 3301 + capacity: 6339 parking: duration: 1 noise: 1 @@ -1342,10 +1342,10 @@ vessels: initial_port_name: qingdao_chn route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 pcc1_vessel_000: - capacity: 2461 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 9 pcc1_vessel_001: - capacity: 2461 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1367,7 +1367,7 @@ vessels: noise: 1 speed: 8 pcc1_vessel_002: - capacity: 2461 + capacity: 4725 parking: duration: 1 noise: 1 @@ -1375,10 +1375,10 @@ vessels: initial_port_name: princeRupert_can route_name: pcc1 sailing: - noise: 2 + noise: 1 speed: 10 pcc2_vessel_000: - capacity: 1221 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1386,10 +1386,10 @@ vessels: initial_port_name: seattle_usa route_name: pcc2 sailing: - noise: 2 + noise: 1 speed: 9 pcc2_vessel_001: - capacity: 1221 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 8 pcc2_vessel_002: - capacity: 1221 + capacity: 2346 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 1064 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1419,10 +1419,10 @@ vessels: initial_port_name: seattle_usa route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 9 pnw1_vessel_001: - capacity: 1064 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 8 pnw1_vessel_002: - capacity: 1064 + capacity: 2044 parking: duration: 1 noise: 1 @@ -1441,10 +1441,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_000: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1455,7 +1455,7 @@ vessels: noise: 1 speed: 9 pnw2_vessel_001: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1463,10 +1463,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 8 pnw2_vessel_002: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1474,10 +1474,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 10 pnw2_vessel_003: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1485,10 +1485,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 9 pnw2_vessel_004: - capacity: 448 + capacity: 861 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 8 saf3_vessel_000: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1507,10 +1507,10 @@ vessels: initial_port_name: yantian_chn route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 saf3_vessel_001: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1518,10 +1518,10 @@ vessels: initial_port_name: qingdao_chn route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 9 saf3_vessel_002: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1529,10 +1529,10 @@ vessels: initial_port_name: singapore_sgp route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 8 saf3_vessel_003: - capacity: 323 + capacity: 621 parking: duration: 1 noise: 1 @@ -1540,10 +1540,10 @@ vessels: initial_port_name: durban_sau route_name: saf3 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_000: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1554,7 +1554,7 @@ vessels: noise: 2 speed: 9 tla2_vessel_001: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1565,7 +1565,7 @@ vessels: noise: 2 speed: 8 tla2_vessel_002: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1576,7 +1576,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_003: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1584,10 +1584,10 @@ vessels: initial_port_name: shanghai_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 9 tla2_vessel_004: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1598,7 +1598,7 @@ vessels: noise: 1 speed: 8 tla2_vessel_005: - capacity: 592 + capacity: 1137 parking: duration: 1 noise: 1 @@ -1606,10 +1606,10 @@ vessels: initial_port_name: yantian_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tlp1_vessel_000: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_001: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1631,7 +1631,7 @@ vessels: noise: 2 speed: 8 tlp1_vessel_002: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_004: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 @@ -1661,10 +1661,10 @@ vessels: initial_port_name: sanAntonio_par route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 8 tlp1_vessel_005: - capacity: 3166 + capacity: 6079 parking: duration: 1 noise: 1 From 51f9568372ec24a5a892eae9b0f2e8646cd7031b Mon Sep 17 00:00:00 2001 From: wesley stone Date: Thu, 22 Oct 2020 18:39:33 +0800 Subject: [PATCH 24/25] fix bugs in learner: no training logic executed --- examples/cim/gnn/learner.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/cim/gnn/learner.py b/examples/cim/gnn/learner.py index da55e3681..2955d4ce1 100644 --- a/examples/cim/gnn/learner.py +++ b/examples/cim/gnn/learner.py @@ -36,7 +36,9 @@ def train(self, training_config, log_pth=None): self._trainable_agents.store_experiences(exp_dict) if training_config.enable and i % training_config.train_freq == training_config.train_freq - 1: + self._logger.info("training start") tick = time.time() + self._trainable_agents.train(training_config) training_time += time.time() - tick if log_pth is not None and (i + 1) % training_config.model_save_freq == 0: From 3804af304185cae285caaa1e77c4aa3a639ec8be Mon Sep 17 00:00:00 2001 From: wesley stone Date: Mon, 26 Oct 2020 11:41:25 +0800 Subject: [PATCH 25/25] revert the topology changes --- examples/cim/gnn/config.yml | 8 +- .../cim/topologies/config_auto_generator.py | 6 +- .../global_trade.22p_l0.0/config.yml | 104 +-- .../global_trade.22p_l0.1/config.yml | 104 +-- .../global_trade.22p_l0.2/config.yml | 104 +-- .../global_trade.22p_l0.3/config.yml | 324 ++++---- .../global_trade.22p_l0.4/config.yml | 682 ++++++++-------- .../global_trade.22p_l0.5/config.yml | 682 ++++++++-------- .../global_trade.22p_l0.6/config.yml | 738 +++++++++--------- .../global_trade.22p_l0.7/config.yml | 730 ++++++++--------- .../global_trade.22p_l0.8/config.yml | 730 ++++++++--------- 11 files changed, 2106 insertions(+), 2106 deletions(-) diff --git a/examples/cim/gnn/config.yml b/examples/cim/gnn/config.yml index 7f332292a..55a249019 100644 --- a/examples/cim/gnn/config.yml +++ b/examples/cim/gnn/config.yml @@ -1,17 +1,17 @@ env: seed: 10 param: - durations: 750 + durations: 1120 scenario: "cim" - # topology: "global_trade.22p_l0.1" - topology: "toy.4p_ssdd_l0.0" + topology: "global_trade.22p_l0.6" + # topology: "toy.4p_ssdd_l0.0" training: enable: True parallel_cnt: 24 device: "cuda:0" batch_size: 150 shuffle_time: 1 - rollout_cnt: 1000 + rollout_cnt: 500 train_freq: 1 model_save_freq: 1 gamma: 0.99 diff --git a/maro/simulator/scenarios/cim/topologies/config_auto_generator.py b/maro/simulator/scenarios/cim/topologies/config_auto_generator.py index d1e95aaf6..86fb4e705 100644 --- a/maro/simulator/scenarios/cim/topologies/config_auto_generator.py +++ b/maro/simulator/scenarios/cim/topologies/config_auto_generator.py @@ -6,11 +6,11 @@ import shutil import random -TOPOLOGY_LIST = ["global_trade.22p"] +TOPOLOGY_LIST = ["toy.4p_ssdd", "toy.5p_ssddd", "toy.6p_sssbdd", "global_trade.22p"] SAILING_TIME = 7 -VESSEL_CAPACITY_REDUNDANCY_RATIOS = [20, 4.5, 4.5, 4.5, 4.5, 4.5, 6.0, 6.0, 6.0] +VESSEL_CAPACITY_REDUNDANCY_RATIOS = [20, 1.5, 1.5, 1.5, 1.5, 1.5, 2.0, 2.5, 2.5] VESSEL_CAPACITY_DELTA_RATIO = 0.1 -AVG_ORDER_RATIO = 0.008 +AVG_ORDER_RATIO = 0.02 ORDER_RATIO_DELTA = 0.005 ORDER_NOISE = 0.002 PERIOD = 112 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml index 43fe45f37..2bec9bd4a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.0/config.yml @@ -1,10 +1,14 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.008 + - 0.02 - - 111 - - 0.008 + - 0.02 sample_noise: 0 container_volumes: - 1 @@ -939,17 +943,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 3095 + capacity: 7739 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 3095 + capacity: 7739 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 1751 + capacity: 4379 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 1751 + capacity: 4379 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 18427 + capacity: 46069 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 18427 + capacity: 46069 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 3673 + capacity: 9182 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 3673 + capacity: 9182 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 4531 + capacity: 11328 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 4531 + capacity: 11328 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 21132 + capacity: 52831 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 21132 + capacity: 52831 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 21132 + capacity: 52831 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 21132 + capacity: 52831 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 21132 + capacity: 52831 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 21132 + capacity: 52831 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 15752 + capacity: 39380 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 15752 + capacity: 39380 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 15752 + capacity: 39380 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 7820 + capacity: 19551 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 7820 + capacity: 19551 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 7820 + capacity: 19551 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 6815 + capacity: 17039 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 6815 + capacity: 17039 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 6815 + capacity: 17039 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 2871 + capacity: 7178 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 2871 + capacity: 7178 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 2871 + capacity: 7178 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 2871 + capacity: 7178 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 2871 + capacity: 7178 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 2070 + capacity: 5177 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 2070 + capacity: 5177 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 2070 + capacity: 5177 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 2070 + capacity: 5177 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 3792 + capacity: 9480 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 3792 + capacity: 9480 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 3792 + capacity: 9480 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 3792 + capacity: 9480 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 3792 + capacity: 9480 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 3792 + capacity: 9480 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 20264 + capacity: 50660 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 20264 + capacity: 50660 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 20264 + capacity: 50660 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 20264 + capacity: 50660 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 20264 + capacity: 50660 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 20264 + capacity: 50660 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml index 9ecce7b5a..d5ff25c1a 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.1/config.yml @@ -1,10 +1,14 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.008 + - 0.02 - - 111 - - 0.008 + - 0.02 sample_noise: 0 container_volumes: - 1 @@ -939,17 +943,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 696 + capacity: 580 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 696 + capacity: 580 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 394 + capacity: 328 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 394 + capacity: 328 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 4146 + capacity: 3455 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 4146 + capacity: 3455 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 826 + capacity: 688 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 826 + capacity: 688 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 1019 + capacity: 849 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 1019 + capacity: 849 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml index 9ecce7b5a..eed3f56b0 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.2/config.yml @@ -1,10 +1,14 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.008 + - 0.02 - - 111 - - 0.008 + - 0.02 sample_noise: 0 container_volumes: - 1 @@ -939,17 +943,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 696 + capacity: 522 parking: duration: 1 noise: 0 @@ -960,7 +960,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 696 + capacity: 580 parking: duration: 1 noise: 0 @@ -971,7 +971,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 394 + capacity: 360 parking: duration: 1 noise: 0 @@ -982,7 +982,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 394 + capacity: 296 parking: duration: 1 noise: 0 @@ -993,7 +993,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 4146 + capacity: 3455 parking: duration: 1 noise: 0 @@ -1004,7 +1004,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 4146 + capacity: 3800 parking: duration: 1 noise: 0 @@ -1015,7 +1015,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 826 + capacity: 620 parking: duration: 1 noise: 0 @@ -1026,7 +1026,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 826 + capacity: 688 parking: duration: 1 noise: 0 @@ -1037,7 +1037,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 1019 + capacity: 933 parking: duration: 1 noise: 0 @@ -1048,7 +1048,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 1019 + capacity: 765 parking: duration: 1 noise: 0 @@ -1059,7 +1059,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1070,7 +1070,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1081,7 +1081,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1092,7 +1092,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1103,7 +1103,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1114,7 +1114,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1125,7 +1125,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1136,7 +1136,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3544 + capacity: 3248 parking: duration: 1 noise: 0 @@ -1147,7 +1147,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 3544 + capacity: 2658 parking: duration: 1 noise: 0 @@ -1158,7 +1158,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1169,7 +1169,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1759 + capacity: 1612 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1759 + capacity: 1320 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1533 + capacity: 1404 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1533 + capacity: 1150 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 646 + capacity: 485 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 465 + capacity: 426 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml index 8b808a4f1..0915011f4 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.3/config.yml @@ -1,230 +1,234 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.003 + - 0.015 - - 1 - - 0.003007865924910917 + - 0.015007865924910917 - - 2 - - 0.003031438950533787 + - 0.015031438950533788 - - 3 - - 0.003070644907408821 + - 0.015070644907408821 - - 4 - - 0.0031253604390908823 + - 0.015125360439090883 - - 5 - - 0.003195413390274502 + - 0.015195413390274502 - - 6 - - 0.0032805833484581626 + - 0.015280583348458162 - - 7 - - 0.003380602337443566 + - 0.015380602337443566 - - 8 - - 0.0034951556604879046 + - 0.015495155660487904 - - 9 - - 0.0036238828904562315 + - 0.015623882890456232 - - 10 - - 0.0037663790038585795 + - 0.015766379003858577 - - 11 - - 0.003922195655203699 + - 0.0159221956552037 - - 12 - - 0.004090842587659851 + - 0.016090842587659852 - - 13 - - 0.004271789175584172 + - 0.016271789175584174 - - 14 - - 0.004464466094067262 + - 0.01646446609406726 - - 15 - - 0.004668267110239981 + - 0.01666826711023998 - - 16 - - 0.004882550990706332 + - 0.016882550990706333 - - 17 - - 0.0051066435191009715 + - 0.017106643519100972 - - 18 - - 0.005339839617423317 + - 0.017339839617423317 - - 19 - - 0.005581405564473801 + - 0.017581405564473802 - - 20 - - 0.005830581304412209 + - 0.01783058130441221 - - 21 - - 0.006086582838174551 + - 0.01808658283817455 - - 22 - - 0.006348604690224164 + - 0.018348604690224164 - - 23 - - 0.006615822442875753 + - 0.018615822442875754 - - 24 - - 0.006887395330218428 + - 0.018887395330218427 - - 25 - - 0.007162468883476318 + - 0.01916246888347632 - - 26 - - 0.00744017761948346 + - 0.01944017761948346 - - 27 - - 0.007719647763814041 + - 0.01971964776381404 - - 28 - - 0.008 + - 0.02 - - 29 - - 0.00828035223618596 + - 0.02028035223618596 - - 30 - - 0.00855982238051654 + - 0.02055982238051654 - - 31 - - 0.008837531116523682 + - 0.020837531116523682 - - 32 - - 0.009112604669781572 + - 0.02111260466978157 - - 33 - - 0.009384177557124247 + - 0.021384177557124247 - - 34 - - 0.009651395309775834 + - 0.021651395309775834 - - 35 - - 0.00991341716182545 + - 0.02191341716182545 - - 36 - - 0.01016941869558779 + - 0.022169418695587792 - - 37 - - 0.010418594435526198 + - 0.0224185944355262 - - 38 - - 0.010660160382576682 + - 0.022660160382576684 - - 39 - - 0.010893356480899029 + - 0.02289335648089903 - - 40 - - 0.011117449009293668 + - 0.023117449009293668 - - 41 - - 0.01133173288976002 + - 0.02333173288976002 - - 42 - - 0.011535533905932737 + - 0.023535533905932736 - - 43 - - 0.011728210824415828 + - 0.023728210824415827 - - 44 - - 0.011909157412340148 + - 0.02390915741234015 - - 45 - - 0.0120778043447963 + - 0.0240778043447963 - - 46 - - 0.01223362099614142 + - 0.02423362099614142 - - 47 - - 0.012376117109543769 + - 0.02437611710954377 - - 48 - - 0.012504844339512097 + - 0.024504844339512097 - - 49 - - 0.012619397662556434 + - 0.024619397662556435 - - 50 - - 0.012719416651541839 + - 0.02471941665154184 - - 51 - - 0.012804586609725499 + - 0.0248045866097255 - - 52 - - 0.012874639560909118 + - 0.024874639560909118 - - 53 - - 0.01292935509259118 + - 0.024929355092591178 - - 54 - - 0.012968561049466212 + - 0.024968561049466213 - - 55 - - 0.012992134075089083 + - 0.024992134075089083 - - 56 - - 0.013000000000000001 + - 0.025 - - 57 - - 0.012992134075089083 + - 0.024992134075089083 - - 58 - - 0.012968561049466212 + - 0.024968561049466213 - - 59 - - 0.01292935509259118 + - 0.024929355092591178 - - 60 - - 0.012874639560909118 + - 0.024874639560909118 - - 61 - - 0.012804586609725499 + - 0.0248045866097255 - - 62 - - 0.012719416651541839 + - 0.02471941665154184 - - 63 - - 0.012619397662556434 + - 0.024619397662556435 - - 64 - - 0.012504844339512097 + - 0.024504844339512097 - - 65 - - 0.012376117109543769 + - 0.02437611710954377 - - 66 - - 0.012233620996141422 + - 0.024233620996141424 - - 67 - - 0.012077804344796302 + - 0.024077804344796304 - - 68 - - 0.011909157412340152 + - 0.023909157412340152 - - 69 - - 0.011728210824415828 + - 0.02372821082441583 - - 70 - - 0.01153553390593274 + - 0.02353553390593274 - - 71 - - 0.01133173288976002 + - 0.02333173288976002 - - 72 - - 0.011117449009293668 + - 0.023117449009293668 - - 73 - - 0.010893356480899029 + - 0.02289335648089903 - - 74 - - 0.010660160382576684 + - 0.022660160382576684 - - 75 - - 0.010418594435526202 + - 0.022418594435526202 - - 76 - - 0.010169418695587792 + - 0.022169418695587792 - - 77 - - 0.009913417161825451 + - 0.021913417161825453 - - 78 - - 0.009651395309775837 + - 0.021651395309775837 - - 79 - - 0.009384177557124247 + - 0.021384177557124247 - - 80 - - 0.009112604669781574 + - 0.021112604669781574 - - 81 - - 0.008837531116523686 + - 0.020837531116523686 - - 82 - - 0.00855982238051654 + - 0.02055982238051654 - - 83 - - 0.008280352236185957 + - 0.020280352236185958 - - 84 - - 0.008000000000000002 + - 0.02 - - 85 - - 0.007719647763814045 + - 0.019719647763814043 - - 86 - - 0.007440177619483462 + - 0.01944017761948346 - - 87 - - 0.007162468883476316 + - 0.01916246888347632 - - 88 - - 0.006887395330218429 + - 0.01888739533021843 - - 89 - - 0.006615822442875756 + - 0.018615822442875758 - - 90 - - 0.006348604690224166 + - 0.018348604690224167 - - 91 - - 0.00608658283817455 + - 0.01808658283817455 - - 92 - - 0.00583058130441221 + - 0.01783058130441221 - - 93 - - 0.0055814055644738 + - 0.0175814055644738 - - 94 - - 0.005339839617423318 + - 0.01733983961742332 - - 95 - - 0.005106643519100974 + - 0.017106643519100975 - - 96 - - 0.004882550990706333 + - 0.016882550990706333 - - 97 - - 0.004668267110239979 + - 0.01666826711023998 - - 98 - - 0.004464466094067263 + - 0.016464466094067265 - - 99 - - 0.004271789175584174 + - 0.016271789175584174 - - 100 - - 0.004090842587659851 + - 0.016090842587659852 - - 101 - - 0.0039221956552036984 + - 0.015922195655203697 - - 102 - - 0.0037663790038585804 + - 0.01576637900385858 - - 103 - - 0.003623882890456233 + - 0.015623882890456233 - - 104 - - 0.0034951556604879046 + - 0.015495155660487904 - - 105 - - 0.003380602337443568 + - 0.015380602337443568 - - 106 - - 0.0032805833484581626 + - 0.015280583348458162 - - 107 - - 0.003195413390274502 + - 0.015195413390274502 - - 108 - - 0.0031253604390908823 + - 0.015125360439090883 - - 109 - - 0.003070644907408821 + - 0.015070644907408821 - - 110 - - 0.003031438950533787 + - 0.015031438950533788 - - 111 - - 0.003007865924910917 + - 0.015007865924910917 sample_noise: 0 container_volumes: - 1 @@ -1159,17 +1163,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 696 + capacity: 522 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 696 + capacity: 580 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 394 + capacity: 360 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 394 + capacity: 296 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 4146 + capacity: 3455 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 4146 + capacity: 3800 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 826 + capacity: 620 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 826 + capacity: 688 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 1019 + capacity: 933 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 1019 + capacity: 765 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3544 + capacity: 3248 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 3544 + capacity: 2658 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1759 + capacity: 1612 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1759 + capacity: 1320 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1533 + capacity: 1404 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1533 + capacity: 1150 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 646 + capacity: 485 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 465 + capacity: 426 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml index 6a571ab80..6d6afb35e 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.4/config.yml @@ -1,230 +1,234 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.003 + - 0.015 - - 1 - - 0.003007865924910917 + - 0.015007865924910917 - - 2 - - 0.003031438950533787 + - 0.015031438950533788 - - 3 - - 0.003070644907408821 + - 0.015070644907408821 - - 4 - - 0.0031253604390908823 + - 0.015125360439090883 - - 5 - - 0.003195413390274502 + - 0.015195413390274502 - - 6 - - 0.0032805833484581626 + - 0.015280583348458162 - - 7 - - 0.003380602337443566 + - 0.015380602337443566 - - 8 - - 0.0034951556604879046 + - 0.015495155660487904 - - 9 - - 0.0036238828904562315 + - 0.015623882890456232 - - 10 - - 0.0037663790038585795 + - 0.015766379003858577 - - 11 - - 0.003922195655203699 + - 0.0159221956552037 - - 12 - - 0.004090842587659851 + - 0.016090842587659852 - - 13 - - 0.004271789175584172 + - 0.016271789175584174 - - 14 - - 0.004464466094067262 + - 0.01646446609406726 - - 15 - - 0.004668267110239981 + - 0.01666826711023998 - - 16 - - 0.004882550990706332 + - 0.016882550990706333 - - 17 - - 0.0051066435191009715 + - 0.017106643519100972 - - 18 - - 0.005339839617423317 + - 0.017339839617423317 - - 19 - - 0.005581405564473801 + - 0.017581405564473802 - - 20 - - 0.005830581304412209 + - 0.01783058130441221 - - 21 - - 0.006086582838174551 + - 0.01808658283817455 - - 22 - - 0.006348604690224164 + - 0.018348604690224164 - - 23 - - 0.006615822442875753 + - 0.018615822442875754 - - 24 - - 0.006887395330218428 + - 0.018887395330218427 - - 25 - - 0.007162468883476318 + - 0.01916246888347632 - - 26 - - 0.00744017761948346 + - 0.01944017761948346 - - 27 - - 0.007719647763814041 + - 0.01971964776381404 - - 28 - - 0.008 + - 0.02 - - 29 - - 0.00828035223618596 + - 0.02028035223618596 - - 30 - - 0.00855982238051654 + - 0.02055982238051654 - - 31 - - 0.008837531116523682 + - 0.020837531116523682 - - 32 - - 0.009112604669781572 + - 0.02111260466978157 - - 33 - - 0.009384177557124247 + - 0.021384177557124247 - - 34 - - 0.009651395309775834 + - 0.021651395309775834 - - 35 - - 0.00991341716182545 + - 0.02191341716182545 - - 36 - - 0.01016941869558779 + - 0.022169418695587792 - - 37 - - 0.010418594435526198 + - 0.0224185944355262 - - 38 - - 0.010660160382576682 + - 0.022660160382576684 - - 39 - - 0.010893356480899029 + - 0.02289335648089903 - - 40 - - 0.011117449009293668 + - 0.023117449009293668 - - 41 - - 0.01133173288976002 + - 0.02333173288976002 - - 42 - - 0.011535533905932737 + - 0.023535533905932736 - - 43 - - 0.011728210824415828 + - 0.023728210824415827 - - 44 - - 0.011909157412340148 + - 0.02390915741234015 - - 45 - - 0.0120778043447963 + - 0.0240778043447963 - - 46 - - 0.01223362099614142 + - 0.02423362099614142 - - 47 - - 0.012376117109543769 + - 0.02437611710954377 - - 48 - - 0.012504844339512097 + - 0.024504844339512097 - - 49 - - 0.012619397662556434 + - 0.024619397662556435 - - 50 - - 0.012719416651541839 + - 0.02471941665154184 - - 51 - - 0.012804586609725499 + - 0.0248045866097255 - - 52 - - 0.012874639560909118 + - 0.024874639560909118 - - 53 - - 0.01292935509259118 + - 0.024929355092591178 - - 54 - - 0.012968561049466212 + - 0.024968561049466213 - - 55 - - 0.012992134075089083 + - 0.024992134075089083 - - 56 - - 0.013000000000000001 + - 0.025 - - 57 - - 0.012992134075089083 + - 0.024992134075089083 - - 58 - - 0.012968561049466212 + - 0.024968561049466213 - - 59 - - 0.01292935509259118 + - 0.024929355092591178 - - 60 - - 0.012874639560909118 + - 0.024874639560909118 - - 61 - - 0.012804586609725499 + - 0.0248045866097255 - - 62 - - 0.012719416651541839 + - 0.02471941665154184 - - 63 - - 0.012619397662556434 + - 0.024619397662556435 - - 64 - - 0.012504844339512097 + - 0.024504844339512097 - - 65 - - 0.012376117109543769 + - 0.02437611710954377 - - 66 - - 0.012233620996141422 + - 0.024233620996141424 - - 67 - - 0.012077804344796302 + - 0.024077804344796304 - - 68 - - 0.011909157412340152 + - 0.023909157412340152 - - 69 - - 0.011728210824415828 + - 0.02372821082441583 - - 70 - - 0.01153553390593274 + - 0.02353553390593274 - - 71 - - 0.01133173288976002 + - 0.02333173288976002 - - 72 - - 0.011117449009293668 + - 0.023117449009293668 - - 73 - - 0.010893356480899029 + - 0.02289335648089903 - - 74 - - 0.010660160382576684 + - 0.022660160382576684 - - 75 - - 0.010418594435526202 + - 0.022418594435526202 - - 76 - - 0.010169418695587792 + - 0.022169418695587792 - - 77 - - 0.009913417161825451 + - 0.021913417161825453 - - 78 - - 0.009651395309775837 + - 0.021651395309775837 - - 79 - - 0.009384177557124247 + - 0.021384177557124247 - - 80 - - 0.009112604669781574 + - 0.021112604669781574 - - 81 - - 0.008837531116523686 + - 0.020837531116523686 - - 82 - - 0.00855982238051654 + - 0.02055982238051654 - - 83 - - 0.008280352236185957 + - 0.020280352236185958 - - 84 - - 0.008000000000000002 + - 0.02 - - 85 - - 0.007719647763814045 + - 0.019719647763814043 - - 86 - - 0.007440177619483462 + - 0.01944017761948346 - - 87 - - 0.007162468883476316 + - 0.01916246888347632 - - 88 - - 0.006887395330218429 + - 0.01888739533021843 - - 89 - - 0.006615822442875756 + - 0.018615822442875758 - - 90 - - 0.006348604690224166 + - 0.018348604690224167 - - 91 - - 0.00608658283817455 + - 0.01808658283817455 - - 92 - - 0.00583058130441221 + - 0.01783058130441221 - - 93 - - 0.0055814055644738 + - 0.0175814055644738 - - 94 - - 0.005339839617423318 + - 0.01733983961742332 - - 95 - - 0.005106643519100974 + - 0.017106643519100975 - - 96 - - 0.004882550990706333 + - 0.016882550990706333 - - 97 - - 0.004668267110239979 + - 0.01666826711023998 - - 98 - - 0.004464466094067263 + - 0.016464466094067265 - - 99 - - 0.004271789175584174 + - 0.016271789175584174 - - 100 - - 0.004090842587659851 + - 0.016090842587659852 - - 101 - - 0.0039221956552036984 + - 0.015922195655203697 - - 102 - - 0.0037663790038585804 + - 0.01576637900385858 - - 103 - - 0.003623882890456233 + - 0.015623882890456233 - - 104 - - 0.0034951556604879046 + - 0.015495155660487904 - - 105 - - 0.003380602337443568 + - 0.015380602337443568 - - 106 - - 0.0032805833484581626 + - 0.015280583348458162 - - 107 - - 0.003195413390274502 + - 0.015195413390274502 - - 108 - - 0.0031253604390908823 + - 0.015125360439090883 - - 109 - - 0.003070644907408821 + - 0.015070644907408821 - - 110 - - 0.003031438950533787 + - 0.015031438950533788 - - 111 - - 0.003007865924910917 + - 0.015007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +245,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.029541906819651888 + noise: 0.025134751494652507 proportion: 0.16 targets: leHavre_fra: - noise: 0.027174439537617754 + noise: 0.025432733187591285 proportion: 0.18755329471737509 montreal_can: - noise: 0.00980727387825093 + noise: 0.014981815264884504 proportion: 0.0756906048807678 newYork_usa: - noise: 0.0027637832634372895 + noise: 0.07860790872534353 proportion: 0.47933778254893905 pusan_kor: - noise: 0.014430384061284766 + noise: 0.002902145091237068 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.006930094460708154 + noise: 0.0016703057083900894 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.008742270235780183 + noise: 0.004329384963154748 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0011347602771777819 + noise: 0.00014700838968303593 proportion: 0.005882857005910926 yantian_chn: - noise: 0.006193414953469088 + noise: 0.014277274600949947 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +283,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012369701713498126 + noise: 0.0003905851406890507 proportion: 0.01 targets: qingdao_chn: - noise: 0.012364772365962309 + noise: 0.03386602700899302 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.00352215419270645 + noise: 0.04099351916502508 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.028599483759999704 + noise: 0.02983331512414685 proportion: 0.24812321657873454 yantian_chn: - noise: 0.04900330203859365 + noise: 0.0398838857119423 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +309,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0009621506996928753 + noise: 0.0017049012580563228 proportion: 0.01 targets: qingdao_chn: - noise: 0.026090492586688295 + noise: 0.006704071585248814 proportion: 0.19992517767067194 santos_bra: - noise: 0.012641742172183024 + noise: 0.01065215665926791 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.03176028945781009 + noise: 0.01889939427623029 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.009817528692331708 + noise: 0.030425501405892584 proportion: 0.19775168293424744 yantian_chn: - noise: 0.009621093160930289 + noise: 0.0038049637706619867 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +338,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.0018886517487191057 + noise: 0.010023093144315015 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.004315181577345305 + noise: 0.046713884416130814 proportion: 0.2613085269688243 montreal_can: - noise: 0.016843903962712903 + noise: 0.007011738109808054 proportion: 0.09474419644790176 newYork_usa: - noise: 0.009488796573182388 + noise: 0.0075575968616494 proportion: 0.20255309034522379 pusan_kor: - noise: 0.016473206464419552 + noise: 0.0022204132834372364 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.016694752769885985 + noise: 0.0025163323117031356 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.01034247956021821 + noise: 0.012253843912920523 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0017025555020105283 + noise: 0.014556815408633276 proportion: 0.07609945087001035 yantian_chn: - noise: 0.012420348270095348 + noise: 0.007509358525794673 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +376,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0010398317467610486 + noise: 0.007441531984981497 proportion: 0.05 targets: oakland_usa: - noise: 0.046610961242872055 + noise: 0.04265188459544233 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.0034681253869941176 + noise: 0.00273897680516611 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.021860225648515103 + noise: 0.01517255937598155 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04086143525071624 + noise: 0.014299850500812094 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.003862724565463262 + noise: 0.0051011672478115 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +405,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0076983570213705055 + noise: 0.005425915310841583 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0046065639504877355 + noise: 0.0073296927183103605 proportion: 0.1642819028757581 pusan_kor: - noise: 0.0025188189984588993 + noise: 0.018169915140256784 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.007167172404922409 + noise: 0.02383787277319661 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.004215477057755458 + noise: 0.0025563544317216205 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0015807008466467236 + noise: 0.02058384394808081 proportion: 0.11985637174894495 yantian_chn: - noise: 0.004717980724301031 + noise: 0.00989286132515691 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027332270387564594 + noise: 0.0007488162438248653 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +440,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.00041927575320429856 + noise: 0.0029979553756433923 proportion: 0.015 targets: singapore_sgp: - noise: 0.01720316773737656 + noise: 0.0566906410775888 proportion: 0.3293364398135728 sydney_aus: - noise: 0.0317483357682384 + noise: 0.01865388192132147 proportion: 0.3364188275147848 yantian_chn: - noise: 6.275255136458467e-05 + noise: 0.014238633997660635 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +463,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0001058824653549524 + noise: 0.0005621554647653919 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08372460982561138 + noise: 0.08779643369212999 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.005206377376346192 + noise: 0.07842477295179612 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +483,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0023971524264589056 + noise: 0.00016057717079772171 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.10416372800484693 + noise: 0.05981761122488196 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.05774414602239579 + noise: 0.03990533991720246 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +503,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.005226544429947875 + noise: 0.004910915544061917 proportion: 0.03 targets: losAngeles_usa: - noise: 0.054178562561998066 + noise: 0.048963812038470556 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.044477996162498444 + noise: 0.0254961817963097 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03359401622082758 + noise: 0.03349874892050399 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.04268416733729023 + noise: 0.012993114869682515 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +529,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029718257861642474 + noise: 0.0027667472862969076 proportion: 0.015 targets: losAngeles_usa: - noise: 0.008826102450863998 + noise: 0.05091486367601389 proportion: 0.2657898185062753 oakland_usa: - noise: 0.0011354503888720232 + noise: 0.028397329439457514 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.014679852245526353 + noise: 0.0016646658939369785 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.044867678747918735 + noise: 0.013742472852754001 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +555,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.002973353584364918 + noise: 0.009320427377742116 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.015482405581896957 + noise: 0.031991420231325084 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.0001302647468009758 + noise: 0.005105457599858164 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.010572876890368834 + noise: 0.005809147275802185 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0025256790825975454 + noise: 0.0033945457967072133 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.0010682303655455128 + noise: 0.001854192137165468 proportion: 0.035795894860646466 seattle_usa: - noise: 0.009613260507944536 + noise: 0.018330317944630015 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.0078571916664256 + noise: 0.009459052846765289 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0034843695558064575 + noise: 0.0016197423680226325 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00964564143149089 + noise: 0.00469787131269142 proportion: 0.059258114284493034 yantian_chn: - noise: 0.006902002888592339 + noise: 0.003856257701007031 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.011337884438636026 + noise: 0.014803870326138143 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +602,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.010033077426210528 + noise: 0.007181454765417904 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02614017182248326 + noise: 0.02952708760272511 proportion: 0.19166868266386958 durban_sau: - noise: 0.0017387242678691362 + noise: 0.0026860007722877676 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0003486452742150132 + noise: 0.0023058721270403397 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.009182092408099281 + noise: 0.008262798336030506 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.022644078007304263 + noise: 0.014599621251693524 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.0076428490407138075 + noise: 0.004578888771735588 proportion: 0.061252276599797005 oakland_usa: - noise: 0.00338044200189517 + noise: 0.0018968128853613635 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.0005795702643972235 + noise: 7.825075850514062e-05 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0034591090510660938 + noise: 0.0007151691535729856 proportion: 0.018577689927305203 santos_bra: - noise: 0.0019028622663675436 + noise: 0.0036806154087330586 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0022840751022966794 + noise: 0.0016116464454415448 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0013813896490110294 + noise: 0.0011503058311188963 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0014244818796804444 + noise: 0.0031091344585237185 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0026191834198310256 + noise: 0.0017512950798533396 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.003894234191508894 + noise: 0.023837737047619264 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +661,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012134052104793088 + noise: 0.0015229565945744795 proportion: 0.01 targets: manzanillo_mex: - noise: 0.012532297887460412 + noise: 0.029864110340333205 proportion: 0.1695702560614863 pusan_kor: - noise: 0.01302248526372375 + noise: 0.030434021872288986 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.005397619577307389 + noise: 0.031654173870326326 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.01679312314459858 + noise: 0.022840905205567065 proportion: 0.16105317774270345 yantian_chn: - noise: 0.019729642431771596 + noise: 0.022058626605590343 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.0055375795509528414 + noise: 0.020882193597463152 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +693,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.001877414087116521 + noise: 0.0017591918390130468 proportion: 0.01 targets: itagual_bra: - noise: 0.032004242821693965 + noise: 0.00015677478442405662 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.02033932536567358 + noise: 0.007951708444894913 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.03140598123730028 + noise: 0.008394529742993468 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01821241418824103 + noise: 0.01406059678653582 proportion: 0.19775168256638195 yantian_chn: - noise: 0.0026235148173812395 + noise: 0.011310434190498734 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +722,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.003107859253019168 + noise: 0.009178972285261822 proportion: 0.07 targets: losAngeles_usa: - noise: 0.05753073850487432 + noise: 0.023523817623575388 proportion: 0.2912736754142012 pusan_kor: - noise: 0.0016502073135337876 + noise: 0.01876947062956955 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.011314497001275887 + noise: 0.02029673306956859 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.005508132238408478 + noise: 0.011329185762784782 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.019332283176789165 + noise: 0.00024014816912197655 proportion: 0.09977785851511455 vancouver_can: - noise: 0.006127488353504421 + noise: 0.02057342705041732 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01754766809268637 + noise: 0.020083358186626803 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +757,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017095220699748878 + noise: 0.017109626305467616 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.041084325927985985 + noise: 0.021959106592952006 proportion: 0.21398371679064213 durban_sau: - noise: 0.0021696529552618954 + noise: 0.00010435314516980227 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0008030025073271739 + noise: 0.0020594969751376174 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0015848506299856926 + noise: 0.0009873199353313093 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.00755174044562672 + noise: 0.014743978442771179 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.011854629177267675 + noise: 0.0012374290703743276 proportion: 0.05976808154382374 oakland_usa: - noise: 0.028784906675318727 + noise: 0.022426459611386496 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0017948328245855443 + noise: 0.0005070099495173756 proportion: 0.00930596400725694 qingdao_chn: - noise: 0.000182985585552497 + noise: 1.8783239577936313e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0007693144229259965 + noise: 0.0012407696401487867 proportion: 0.011430536346128936 seattle_usa: - noise: 0.015979262018439678 + noise: 0.011299147787220907 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0006937704178989623 + noise: 0.002147321460772641 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0012210056169907513 + noise: 0.000883163479902347 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.010669005317136996 + noise: 0.012495339718107597 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +813,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0012836259212510967 + noise: 0.0014198451145378962 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02731130789420123 + noise: 0.02403294164090424 proportion: 0.16163465526933787 durban_sau: - noise: 0.0079917530205346 + noise: 0.007339857249890276 proportion: 0.052947229587582224 itagual_bra: - noise: 0.007301258651251609 + noise: 0.004826948332878951 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.0022920930271172033 + noise: 0.000697323478201817 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.000927122980718493 + noise: 0.009748446374379698 proportion: 0.054598902525719965 pusan_kor: - noise: 0.001481325232631238 + noise: 0.0052864459821632135 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0035672054884738702 + noise: 0.00020264478777542088 proportion: 0.04380756610509279 santos_bra: - noise: 0.0072911626019552455 + noise: 0.0060662606703405855 proportion: 0.0496114180206766 seattle_usa: - noise: 0.021977682321328896 + noise: 0.002184489196293904 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.006000301686369274 + noise: 0.00446890645579302 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.005118668874191572 + noise: 0.0005079804300151535 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0014991769548569809 + noise: 0.0032814259751614335 proportion: 0.053961624659387086 vancouver_can: - noise: 0.008355987327740363 + noise: 0.0013725415556900408 proportion: 0.04942443509903704 yantian_chn: - noise: 0.00424493151411591 + noise: 0.007866049277209214 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.023481573062834743 + noise: 0.013995694253814077 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +872,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002155120895930923 + noise: 5.318259543305715e-05 proportion: 0.015 targets: melbourne_aus: - noise: 0.043272556095345846 + noise: 0.010959524006592607 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.021150293369866142 + noise: 0.013378806626384264 proportion: 0.3291642505650358 yantian_chn: - noise: 0.032126637177988214 + noise: 0.043398566324619615 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +895,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.0017361691924081258 + noise: 0.002260078974868654 proportion: 0.02 targets: pusan_kor: - noise: 0.030070192002213465 + noise: 0.01022517907397126 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.0007756258463724296 + noise: 0.025111111836521687 proportion: 0.16078294599848347 seattle_usa: - noise: 0.034787830472740866 + noise: 0.025666860266381805 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.028936107345725295 + noise: 0.00391575019491024 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009484290050201566 + noise: 0.009869415376296499 proportion: 0.15641751563334233 yantian_chn: - noise: 0.0057514035358065966 + noise: 0.01646828787230074 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +927,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.008422256646885302 + noise: 0.005460106707641842 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.011723548393014914 + noise: 0.03183934815230198 proportion: 0.23063506921338092 durban_sau: - noise: 0.007028309982650573 + noise: 0.006955761417407662 proportion: 0.036977112629701755 itagual_bra: - noise: 0.0021232511744929236 + noise: 0.003879986047538319 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.01244233221440464 + noise: 0.0033746270986396783 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.005219875180760516 + noise: 0.014297914647911386 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.00325693140987167 + noise: 0.0055998037357593185 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0020033324939384353 + noise: 0.004337884540903886 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0024288519568081467 + noise: 0.0034845335834618927 proportion: 0.020692152164438926 santos_bra: - noise: 0.005917956078164042 + noise: 0.0023084677027446535 proportion: 0.03103337095193521 seattle_usa: - noise: 0.008224490506305046 + noise: 0.0043141199296154705 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0012713160693603898 + noise: 0.0001996474876791818 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0005993163297166358 + noise: 0.0011502086812016938 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003553789802863408 + noise: 0.0019319056238978993 proportion: 0.03878455068512264 vancouver_can: - noise: 0.005818365387463014 + noise: 0.0007858696914021227 proportion: 0.03070023678474206 yantian_chn: - noise: 0.000937390505729158 + noise: 0.0016168667042640794 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.0075575175422493215 + noise: 0.023246811699828965 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +989,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0008778537933683098 + noise: 0.014254332625813097 proportion: 0.08 targets: manzanillo_mex: - noise: 0.011810938798409994 + noise: 0.03244047063421112 proportion: 0.224773870587767 pusan_kor: - noise: 0.022595884352223653 + noise: 0.018126081484701975 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.024907581311612293 + noise: 0.017152304680050526 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.008287924815679014 + noise: 0.0003086488347039955 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0066037712087852 + noise: 0.0056287128415065625 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.016272909688446892 + noise: 0.019438990767313084 proportion: 0.1115894561579222 yantian_chn: - noise: 0.020166976986305943 + noise: 0.014838419143613479 proportion: 0.14697441091807414 routes: a3s: @@ -1159,17 +1163,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 696 + capacity: 522 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 696 + capacity: 580 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 394 + capacity: 360 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 394 + capacity: 296 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 4146 + capacity: 3455 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 4146 + capacity: 3800 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 826 + capacity: 620 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 826 + capacity: 688 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 1019 + capacity: 933 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 1019 + capacity: 765 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3544 + capacity: 3248 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 3544 + capacity: 2658 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1759 + capacity: 1612 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1759 + capacity: 1320 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1533 + capacity: 1404 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1533 + capacity: 1150 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 646 + capacity: 485 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 465 + capacity: 426 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml index c989dd410..b0a88cf15 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.5/config.yml @@ -1,230 +1,234 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.003 + - 0.015 - - 1 - - 0.003007865924910917 + - 0.015007865924910917 - - 2 - - 0.003031438950533787 + - 0.015031438950533788 - - 3 - - 0.003070644907408821 + - 0.015070644907408821 - - 4 - - 0.0031253604390908823 + - 0.015125360439090883 - - 5 - - 0.003195413390274502 + - 0.015195413390274502 - - 6 - - 0.0032805833484581626 + - 0.015280583348458162 - - 7 - - 0.003380602337443566 + - 0.015380602337443566 - - 8 - - 0.0034951556604879046 + - 0.015495155660487904 - - 9 - - 0.0036238828904562315 + - 0.015623882890456232 - - 10 - - 0.0037663790038585795 + - 0.015766379003858577 - - 11 - - 0.003922195655203699 + - 0.0159221956552037 - - 12 - - 0.004090842587659851 + - 0.016090842587659852 - - 13 - - 0.004271789175584172 + - 0.016271789175584174 - - 14 - - 0.004464466094067262 + - 0.01646446609406726 - - 15 - - 0.004668267110239981 + - 0.01666826711023998 - - 16 - - 0.004882550990706332 + - 0.016882550990706333 - - 17 - - 0.0051066435191009715 + - 0.017106643519100972 - - 18 - - 0.005339839617423317 + - 0.017339839617423317 - - 19 - - 0.005581405564473801 + - 0.017581405564473802 - - 20 - - 0.005830581304412209 + - 0.01783058130441221 - - 21 - - 0.006086582838174551 + - 0.01808658283817455 - - 22 - - 0.006348604690224164 + - 0.018348604690224164 - - 23 - - 0.006615822442875753 + - 0.018615822442875754 - - 24 - - 0.006887395330218428 + - 0.018887395330218427 - - 25 - - 0.007162468883476318 + - 0.01916246888347632 - - 26 - - 0.00744017761948346 + - 0.01944017761948346 - - 27 - - 0.007719647763814041 + - 0.01971964776381404 - - 28 - - 0.008 + - 0.02 - - 29 - - 0.00828035223618596 + - 0.02028035223618596 - - 30 - - 0.00855982238051654 + - 0.02055982238051654 - - 31 - - 0.008837531116523682 + - 0.020837531116523682 - - 32 - - 0.009112604669781572 + - 0.02111260466978157 - - 33 - - 0.009384177557124247 + - 0.021384177557124247 - - 34 - - 0.009651395309775834 + - 0.021651395309775834 - - 35 - - 0.00991341716182545 + - 0.02191341716182545 - - 36 - - 0.01016941869558779 + - 0.022169418695587792 - - 37 - - 0.010418594435526198 + - 0.0224185944355262 - - 38 - - 0.010660160382576682 + - 0.022660160382576684 - - 39 - - 0.010893356480899029 + - 0.02289335648089903 - - 40 - - 0.011117449009293668 + - 0.023117449009293668 - - 41 - - 0.01133173288976002 + - 0.02333173288976002 - - 42 - - 0.011535533905932737 + - 0.023535533905932736 - - 43 - - 0.011728210824415828 + - 0.023728210824415827 - - 44 - - 0.011909157412340148 + - 0.02390915741234015 - - 45 - - 0.0120778043447963 + - 0.0240778043447963 - - 46 - - 0.01223362099614142 + - 0.02423362099614142 - - 47 - - 0.012376117109543769 + - 0.02437611710954377 - - 48 - - 0.012504844339512097 + - 0.024504844339512097 - - 49 - - 0.012619397662556434 + - 0.024619397662556435 - - 50 - - 0.012719416651541839 + - 0.02471941665154184 - - 51 - - 0.012804586609725499 + - 0.0248045866097255 - - 52 - - 0.012874639560909118 + - 0.024874639560909118 - - 53 - - 0.01292935509259118 + - 0.024929355092591178 - - 54 - - 0.012968561049466212 + - 0.024968561049466213 - - 55 - - 0.012992134075089083 + - 0.024992134075089083 - - 56 - - 0.013000000000000001 + - 0.025 - - 57 - - 0.012992134075089083 + - 0.024992134075089083 - - 58 - - 0.012968561049466212 + - 0.024968561049466213 - - 59 - - 0.01292935509259118 + - 0.024929355092591178 - - 60 - - 0.012874639560909118 + - 0.024874639560909118 - - 61 - - 0.012804586609725499 + - 0.0248045866097255 - - 62 - - 0.012719416651541839 + - 0.02471941665154184 - - 63 - - 0.012619397662556434 + - 0.024619397662556435 - - 64 - - 0.012504844339512097 + - 0.024504844339512097 - - 65 - - 0.012376117109543769 + - 0.02437611710954377 - - 66 - - 0.012233620996141422 + - 0.024233620996141424 - - 67 - - 0.012077804344796302 + - 0.024077804344796304 - - 68 - - 0.011909157412340152 + - 0.023909157412340152 - - 69 - - 0.011728210824415828 + - 0.02372821082441583 - - 70 - - 0.01153553390593274 + - 0.02353553390593274 - - 71 - - 0.01133173288976002 + - 0.02333173288976002 - - 72 - - 0.011117449009293668 + - 0.023117449009293668 - - 73 - - 0.010893356480899029 + - 0.02289335648089903 - - 74 - - 0.010660160382576684 + - 0.022660160382576684 - - 75 - - 0.010418594435526202 + - 0.022418594435526202 - - 76 - - 0.010169418695587792 + - 0.022169418695587792 - - 77 - - 0.009913417161825451 + - 0.021913417161825453 - - 78 - - 0.009651395309775837 + - 0.021651395309775837 - - 79 - - 0.009384177557124247 + - 0.021384177557124247 - - 80 - - 0.009112604669781574 + - 0.021112604669781574 - - 81 - - 0.008837531116523686 + - 0.020837531116523686 - - 82 - - 0.00855982238051654 + - 0.02055982238051654 - - 83 - - 0.008280352236185957 + - 0.020280352236185958 - - 84 - - 0.008000000000000002 + - 0.02 - - 85 - - 0.007719647763814045 + - 0.019719647763814043 - - 86 - - 0.007440177619483462 + - 0.01944017761948346 - - 87 - - 0.007162468883476316 + - 0.01916246888347632 - - 88 - - 0.006887395330218429 + - 0.01888739533021843 - - 89 - - 0.006615822442875756 + - 0.018615822442875758 - - 90 - - 0.006348604690224166 + - 0.018348604690224167 - - 91 - - 0.00608658283817455 + - 0.01808658283817455 - - 92 - - 0.00583058130441221 + - 0.01783058130441221 - - 93 - - 0.0055814055644738 + - 0.0175814055644738 - - 94 - - 0.005339839617423318 + - 0.01733983961742332 - - 95 - - 0.005106643519100974 + - 0.017106643519100975 - - 96 - - 0.004882550990706333 + - 0.016882550990706333 - - 97 - - 0.004668267110239979 + - 0.01666826711023998 - - 98 - - 0.004464466094067263 + - 0.016464466094067265 - - 99 - - 0.004271789175584174 + - 0.016271789175584174 - - 100 - - 0.004090842587659851 + - 0.016090842587659852 - - 101 - - 0.0039221956552036984 + - 0.015922195655203697 - - 102 - - 0.0037663790038585804 + - 0.01576637900385858 - - 103 - - 0.003623882890456233 + - 0.015623882890456233 - - 104 - - 0.0034951556604879046 + - 0.015495155660487904 - - 105 - - 0.003380602337443568 + - 0.015380602337443568 - - 106 - - 0.0032805833484581626 + - 0.015280583348458162 - - 107 - - 0.003195413390274502 + - 0.015195413390274502 - - 108 - - 0.0031253604390908823 + - 0.015125360439090883 - - 109 - - 0.003070644907408821 + - 0.015070644907408821 - - 110 - - 0.003031438950533787 + - 0.015031438950533788 - - 111 - - 0.003007865924910917 + - 0.015007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +245,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.029541906819651888 + noise: 0.025134751494652507 proportion: 0.16 targets: leHavre_fra: - noise: 0.027174439537617754 + noise: 0.025432733187591285 proportion: 0.18755329471737509 montreal_can: - noise: 0.00980727387825093 + noise: 0.014981815264884504 proportion: 0.0756906048807678 newYork_usa: - noise: 0.0027637832634372895 + noise: 0.07860790872534353 proportion: 0.47933778254893905 pusan_kor: - noise: 0.014430384061284766 + noise: 0.002902145091237068 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.006930094460708154 + noise: 0.0016703057083900894 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.008742270235780183 + noise: 0.004329384963154748 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0011347602771777819 + noise: 0.00014700838968303593 proportion: 0.005882857005910926 yantian_chn: - noise: 0.006193414953469088 + noise: 0.014277274600949947 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +283,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012369701713498126 + noise: 0.0003905851406890507 proportion: 0.01 targets: qingdao_chn: - noise: 0.012364772365962309 + noise: 0.03386602700899302 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.00352215419270645 + noise: 0.04099351916502508 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.028599483759999704 + noise: 0.02983331512414685 proportion: 0.24812321657873454 yantian_chn: - noise: 0.04900330203859365 + noise: 0.0398838857119423 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +309,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0009621506996928753 + noise: 0.0017049012580563228 proportion: 0.01 targets: qingdao_chn: - noise: 0.026090492586688295 + noise: 0.006704071585248814 proportion: 0.19992517767067194 santos_bra: - noise: 0.012641742172183024 + noise: 0.01065215665926791 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.03176028945781009 + noise: 0.01889939427623029 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.009817528692331708 + noise: 0.030425501405892584 proportion: 0.19775168293424744 yantian_chn: - noise: 0.009621093160930289 + noise: 0.0038049637706619867 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +338,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.0018886517487191057 + noise: 0.010023093144315015 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.004315181577345305 + noise: 0.046713884416130814 proportion: 0.2613085269688243 montreal_can: - noise: 0.016843903962712903 + noise: 0.007011738109808054 proportion: 0.09474419644790176 newYork_usa: - noise: 0.009488796573182388 + noise: 0.0075575968616494 proportion: 0.20255309034522379 pusan_kor: - noise: 0.016473206464419552 + noise: 0.0022204132834372364 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.016694752769885985 + noise: 0.0025163323117031356 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.01034247956021821 + noise: 0.012253843912920523 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0017025555020105283 + noise: 0.014556815408633276 proportion: 0.07609945087001035 yantian_chn: - noise: 0.012420348270095348 + noise: 0.007509358525794673 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +376,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0010398317467610486 + noise: 0.007441531984981497 proportion: 0.05 targets: oakland_usa: - noise: 0.046610961242872055 + noise: 0.04265188459544233 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.0034681253869941176 + noise: 0.00273897680516611 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.021860225648515103 + noise: 0.01517255937598155 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04086143525071624 + noise: 0.014299850500812094 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.003862724565463262 + noise: 0.0051011672478115 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +405,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0076983570213705055 + noise: 0.005425915310841583 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0046065639504877355 + noise: 0.0073296927183103605 proportion: 0.1642819028757581 pusan_kor: - noise: 0.0025188189984588993 + noise: 0.018169915140256784 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.007167172404922409 + noise: 0.02383787277319661 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.004215477057755458 + noise: 0.0025563544317216205 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0015807008466467236 + noise: 0.02058384394808081 proportion: 0.11985637174894495 yantian_chn: - noise: 0.004717980724301031 + noise: 0.00989286132515691 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027332270387564594 + noise: 0.0007488162438248653 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +440,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.00041927575320429856 + noise: 0.0029979553756433923 proportion: 0.015 targets: singapore_sgp: - noise: 0.01720316773737656 + noise: 0.0566906410775888 proportion: 0.3293364398135728 sydney_aus: - noise: 0.0317483357682384 + noise: 0.01865388192132147 proportion: 0.3364188275147848 yantian_chn: - noise: 6.275255136458467e-05 + noise: 0.014238633997660635 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +463,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0001058824653549524 + noise: 0.0005621554647653919 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08372460982561138 + noise: 0.08779643369212999 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.005206377376346192 + noise: 0.07842477295179612 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +483,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0023971524264589056 + noise: 0.00016057717079772171 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.10416372800484693 + noise: 0.05981761122488196 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.05774414602239579 + noise: 0.03990533991720246 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +503,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.005226544429947875 + noise: 0.004910915544061917 proportion: 0.03 targets: losAngeles_usa: - noise: 0.054178562561998066 + noise: 0.048963812038470556 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.044477996162498444 + noise: 0.0254961817963097 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03359401622082758 + noise: 0.03349874892050399 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.04268416733729023 + noise: 0.012993114869682515 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +529,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029718257861642474 + noise: 0.0027667472862969076 proportion: 0.015 targets: losAngeles_usa: - noise: 0.008826102450863998 + noise: 0.05091486367601389 proportion: 0.2657898185062753 oakland_usa: - noise: 0.0011354503888720232 + noise: 0.028397329439457514 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.014679852245526353 + noise: 0.0016646658939369785 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.044867678747918735 + noise: 0.013742472852754001 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +555,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.002973353584364918 + noise: 0.009320427377742116 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.015482405581896957 + noise: 0.031991420231325084 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.0001302647468009758 + noise: 0.005105457599858164 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.010572876890368834 + noise: 0.005809147275802185 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0025256790825975454 + noise: 0.0033945457967072133 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.0010682303655455128 + noise: 0.001854192137165468 proportion: 0.035795894860646466 seattle_usa: - noise: 0.009613260507944536 + noise: 0.018330317944630015 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.0078571916664256 + noise: 0.009459052846765289 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0034843695558064575 + noise: 0.0016197423680226325 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00964564143149089 + noise: 0.00469787131269142 proportion: 0.059258114284493034 yantian_chn: - noise: 0.006902002888592339 + noise: 0.003856257701007031 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.011337884438636026 + noise: 0.014803870326138143 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +602,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.010033077426210528 + noise: 0.007181454765417904 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02614017182248326 + noise: 0.02952708760272511 proportion: 0.19166868266386958 durban_sau: - noise: 0.0017387242678691362 + noise: 0.0026860007722877676 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0003486452742150132 + noise: 0.0023058721270403397 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.009182092408099281 + noise: 0.008262798336030506 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.022644078007304263 + noise: 0.014599621251693524 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.0076428490407138075 + noise: 0.004578888771735588 proportion: 0.061252276599797005 oakland_usa: - noise: 0.00338044200189517 + noise: 0.0018968128853613635 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.0005795702643972235 + noise: 7.825075850514062e-05 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0034591090510660938 + noise: 0.0007151691535729856 proportion: 0.018577689927305203 santos_bra: - noise: 0.0019028622663675436 + noise: 0.0036806154087330586 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0022840751022966794 + noise: 0.0016116464454415448 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0013813896490110294 + noise: 0.0011503058311188963 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0014244818796804444 + noise: 0.0031091344585237185 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0026191834198310256 + noise: 0.0017512950798533396 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.003894234191508894 + noise: 0.023837737047619264 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +661,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012134052104793088 + noise: 0.0015229565945744795 proportion: 0.01 targets: manzanillo_mex: - noise: 0.012532297887460412 + noise: 0.029864110340333205 proportion: 0.1695702560614863 pusan_kor: - noise: 0.01302248526372375 + noise: 0.030434021872288986 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.005397619577307389 + noise: 0.031654173870326326 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.01679312314459858 + noise: 0.022840905205567065 proportion: 0.16105317774270345 yantian_chn: - noise: 0.019729642431771596 + noise: 0.022058626605590343 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.0055375795509528414 + noise: 0.020882193597463152 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +693,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.001877414087116521 + noise: 0.0017591918390130468 proportion: 0.01 targets: itagual_bra: - noise: 0.032004242821693965 + noise: 0.00015677478442405662 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.02033932536567358 + noise: 0.007951708444894913 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.03140598123730028 + noise: 0.008394529742993468 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01821241418824103 + noise: 0.01406059678653582 proportion: 0.19775168256638195 yantian_chn: - noise: 0.0026235148173812395 + noise: 0.011310434190498734 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +722,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.003107859253019168 + noise: 0.009178972285261822 proportion: 0.07 targets: losAngeles_usa: - noise: 0.05753073850487432 + noise: 0.023523817623575388 proportion: 0.2912736754142012 pusan_kor: - noise: 0.0016502073135337876 + noise: 0.01876947062956955 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.011314497001275887 + noise: 0.02029673306956859 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.005508132238408478 + noise: 0.011329185762784782 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.019332283176789165 + noise: 0.00024014816912197655 proportion: 0.09977785851511455 vancouver_can: - noise: 0.006127488353504421 + noise: 0.02057342705041732 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01754766809268637 + noise: 0.020083358186626803 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +757,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017095220699748878 + noise: 0.017109626305467616 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.041084325927985985 + noise: 0.021959106592952006 proportion: 0.21398371679064213 durban_sau: - noise: 0.0021696529552618954 + noise: 0.00010435314516980227 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0008030025073271739 + noise: 0.0020594969751376174 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0015848506299856926 + noise: 0.0009873199353313093 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.00755174044562672 + noise: 0.014743978442771179 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.011854629177267675 + noise: 0.0012374290703743276 proportion: 0.05976808154382374 oakland_usa: - noise: 0.028784906675318727 + noise: 0.022426459611386496 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0017948328245855443 + noise: 0.0005070099495173756 proportion: 0.00930596400725694 qingdao_chn: - noise: 0.000182985585552497 + noise: 1.8783239577936313e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0007693144229259965 + noise: 0.0012407696401487867 proportion: 0.011430536346128936 seattle_usa: - noise: 0.015979262018439678 + noise: 0.011299147787220907 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0006937704178989623 + noise: 0.002147321460772641 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0012210056169907513 + noise: 0.000883163479902347 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.010669005317136996 + noise: 0.012495339718107597 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +813,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0012836259212510967 + noise: 0.0014198451145378962 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02731130789420123 + noise: 0.02403294164090424 proportion: 0.16163465526933787 durban_sau: - noise: 0.0079917530205346 + noise: 0.007339857249890276 proportion: 0.052947229587582224 itagual_bra: - noise: 0.007301258651251609 + noise: 0.004826948332878951 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.0022920930271172033 + noise: 0.000697323478201817 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.000927122980718493 + noise: 0.009748446374379698 proportion: 0.054598902525719965 pusan_kor: - noise: 0.001481325232631238 + noise: 0.0052864459821632135 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0035672054884738702 + noise: 0.00020264478777542088 proportion: 0.04380756610509279 santos_bra: - noise: 0.0072911626019552455 + noise: 0.0060662606703405855 proportion: 0.0496114180206766 seattle_usa: - noise: 0.021977682321328896 + noise: 0.002184489196293904 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.006000301686369274 + noise: 0.00446890645579302 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.005118668874191572 + noise: 0.0005079804300151535 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0014991769548569809 + noise: 0.0032814259751614335 proportion: 0.053961624659387086 vancouver_can: - noise: 0.008355987327740363 + noise: 0.0013725415556900408 proportion: 0.04942443509903704 yantian_chn: - noise: 0.00424493151411591 + noise: 0.007866049277209214 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.023481573062834743 + noise: 0.013995694253814077 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +872,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002155120895930923 + noise: 5.318259543305715e-05 proportion: 0.015 targets: melbourne_aus: - noise: 0.043272556095345846 + noise: 0.010959524006592607 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.021150293369866142 + noise: 0.013378806626384264 proportion: 0.3291642505650358 yantian_chn: - noise: 0.032126637177988214 + noise: 0.043398566324619615 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +895,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.0017361691924081258 + noise: 0.002260078974868654 proportion: 0.02 targets: pusan_kor: - noise: 0.030070192002213465 + noise: 0.01022517907397126 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.0007756258463724296 + noise: 0.025111111836521687 proportion: 0.16078294599848347 seattle_usa: - noise: 0.034787830472740866 + noise: 0.025666860266381805 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.028936107345725295 + noise: 0.00391575019491024 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009484290050201566 + noise: 0.009869415376296499 proportion: 0.15641751563334233 yantian_chn: - noise: 0.0057514035358065966 + noise: 0.01646828787230074 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +927,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.008422256646885302 + noise: 0.005460106707641842 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.011723548393014914 + noise: 0.03183934815230198 proportion: 0.23063506921338092 durban_sau: - noise: 0.007028309982650573 + noise: 0.006955761417407662 proportion: 0.036977112629701755 itagual_bra: - noise: 0.0021232511744929236 + noise: 0.003879986047538319 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.01244233221440464 + noise: 0.0033746270986396783 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.005219875180760516 + noise: 0.014297914647911386 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.00325693140987167 + noise: 0.0055998037357593185 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0020033324939384353 + noise: 0.004337884540903886 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0024288519568081467 + noise: 0.0034845335834618927 proportion: 0.020692152164438926 santos_bra: - noise: 0.005917956078164042 + noise: 0.0023084677027446535 proportion: 0.03103337095193521 seattle_usa: - noise: 0.008224490506305046 + noise: 0.0043141199296154705 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0012713160693603898 + noise: 0.0001996474876791818 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0005993163297166358 + noise: 0.0011502086812016938 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003553789802863408 + noise: 0.0019319056238978993 proportion: 0.03878455068512264 vancouver_can: - noise: 0.005818365387463014 + noise: 0.0007858696914021227 proportion: 0.03070023678474206 yantian_chn: - noise: 0.000937390505729158 + noise: 0.0016168667042640794 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.0075575175422493215 + noise: 0.023246811699828965 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +989,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0008778537933683098 + noise: 0.014254332625813097 proportion: 0.08 targets: manzanillo_mex: - noise: 0.011810938798409994 + noise: 0.03244047063421112 proportion: 0.224773870587767 pusan_kor: - noise: 0.022595884352223653 + noise: 0.018126081484701975 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.024907581311612293 + noise: 0.017152304680050526 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.008287924815679014 + noise: 0.0003086488347039955 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0066037712087852 + noise: 0.0056287128415065625 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.016272909688446892 + noise: 0.019438990767313084 proportion: 0.1115894561579222 yantian_chn: - noise: 0.020166976986305943 + noise: 0.014838419143613479 proportion: 0.14697441091807414 routes: a3s: @@ -1159,17 +1163,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 696 + capacity: 522 parking: duration: 1 noise: 0 @@ -1180,7 +1180,7 @@ vessels: noise: 0 speed: 10 a3s_vessel_001: - capacity: 696 + capacity: 580 parking: duration: 1 noise: 0 @@ -1191,7 +1191,7 @@ vessels: noise: 0 speed: 10 asa_vessel_000: - capacity: 394 + capacity: 360 parking: duration: 1 noise: 0 @@ -1202,7 +1202,7 @@ vessels: noise: 0 speed: 10 asa_vessel_001: - capacity: 394 + capacity: 296 parking: duration: 1 noise: 0 @@ -1213,7 +1213,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_000: - capacity: 4146 + capacity: 3455 parking: duration: 1 noise: 0 @@ -1224,7 +1224,7 @@ vessels: noise: 0 speed: 10 ate1_vessel_001: - capacity: 4146 + capacity: 3800 parking: duration: 1 noise: 0 @@ -1235,7 +1235,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_000: - capacity: 826 + capacity: 620 parking: duration: 1 noise: 0 @@ -1246,7 +1246,7 @@ vessels: noise: 0 speed: 10 gex1_vessel_001: - capacity: 826 + capacity: 688 parking: duration: 1 noise: 0 @@ -1257,7 +1257,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_000: - capacity: 1019 + capacity: 933 parking: duration: 1 noise: 0 @@ -1268,7 +1268,7 @@ vessels: noise: 0 speed: 10 ktx5_vessel_001: - capacity: 1019 + capacity: 765 parking: duration: 1 noise: 0 @@ -1279,7 +1279,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_000: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1290,7 +1290,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_001: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1301,7 +1301,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_002: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1312,7 +1312,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_003: - capacity: 4754 + capacity: 3962 parking: duration: 1 noise: 0 @@ -1323,7 +1323,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_004: - capacity: 4754 + capacity: 4358 parking: duration: 1 noise: 0 @@ -1334,7 +1334,7 @@ vessels: noise: 0 speed: 10 ll4_vessel_005: - capacity: 4754 + capacity: 3566 parking: duration: 1 noise: 0 @@ -1345,7 +1345,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_000: - capacity: 3544 + capacity: 2953 parking: duration: 1 noise: 0 @@ -1356,7 +1356,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_001: - capacity: 3544 + capacity: 3248 parking: duration: 1 noise: 0 @@ -1367,7 +1367,7 @@ vessels: noise: 0 speed: 10 pcc1_vessel_002: - capacity: 3544 + capacity: 2658 parking: duration: 1 noise: 0 @@ -1378,7 +1378,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_000: - capacity: 1759 + capacity: 1466 parking: duration: 1 noise: 0 @@ -1389,7 +1389,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_001: - capacity: 1759 + capacity: 1612 parking: duration: 1 noise: 0 @@ -1400,7 +1400,7 @@ vessels: noise: 0 speed: 10 pcc2_vessel_002: - capacity: 1759 + capacity: 1320 parking: duration: 1 noise: 0 @@ -1411,7 +1411,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_000: - capacity: 1533 + capacity: 1277 parking: duration: 1 noise: 0 @@ -1422,7 +1422,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_001: - capacity: 1533 + capacity: 1404 parking: duration: 1 noise: 0 @@ -1433,7 +1433,7 @@ vessels: noise: 0 speed: 10 pnw1_vessel_002: - capacity: 1533 + capacity: 1150 parking: duration: 1 noise: 0 @@ -1444,7 +1444,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_000: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1455,7 +1455,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_001: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1466,7 +1466,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_002: - capacity: 646 + capacity: 485 parking: duration: 1 noise: 0 @@ -1477,7 +1477,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_003: - capacity: 646 + capacity: 538 parking: duration: 1 noise: 0 @@ -1488,7 +1488,7 @@ vessels: noise: 0 speed: 10 pnw2_vessel_004: - capacity: 646 + capacity: 591 parking: duration: 1 noise: 0 @@ -1499,7 +1499,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_000: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1510,7 +1510,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_001: - capacity: 465 + capacity: 388 parking: duration: 1 noise: 0 @@ -1521,7 +1521,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_002: - capacity: 465 + capacity: 426 parking: duration: 1 noise: 0 @@ -1532,7 +1532,7 @@ vessels: noise: 0 speed: 10 saf3_vessel_003: - capacity: 465 + capacity: 350 parking: duration: 1 noise: 0 @@ -1543,7 +1543,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_000: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1554,7 +1554,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_001: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1565,7 +1565,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_002: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1576,7 +1576,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_003: - capacity: 853 + capacity: 711 parking: duration: 1 noise: 0 @@ -1587,7 +1587,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_004: - capacity: 853 + capacity: 782 parking: duration: 1 noise: 0 @@ -1598,7 +1598,7 @@ vessels: noise: 0 speed: 10 tla2_vessel_005: - capacity: 853 + capacity: 640 parking: duration: 1 noise: 0 @@ -1609,7 +1609,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_000: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1620,7 +1620,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_001: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1631,7 +1631,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_002: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 @@ -1642,7 +1642,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_003: - capacity: 4559 + capacity: 3799 parking: duration: 1 noise: 0 @@ -1653,7 +1653,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_004: - capacity: 4559 + capacity: 4178 parking: duration: 1 noise: 0 @@ -1664,7 +1664,7 @@ vessels: noise: 0 speed: 10 tlp1_vessel_005: - capacity: 4559 + capacity: 3420 parking: duration: 1 noise: 0 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml index 1157e932a..79844f0c4 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.6/config.yml @@ -1,230 +1,234 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.003 + - 0.015 - - 1 - - 0.003007865924910917 + - 0.015007865924910917 - - 2 - - 0.003031438950533787 + - 0.015031438950533788 - - 3 - - 0.003070644907408821 + - 0.015070644907408821 - - 4 - - 0.0031253604390908823 + - 0.015125360439090883 - - 5 - - 0.003195413390274502 + - 0.015195413390274502 - - 6 - - 0.0032805833484581626 + - 0.015280583348458162 - - 7 - - 0.003380602337443566 + - 0.015380602337443566 - - 8 - - 0.0034951556604879046 + - 0.015495155660487904 - - 9 - - 0.0036238828904562315 + - 0.015623882890456232 - - 10 - - 0.0037663790038585795 + - 0.015766379003858577 - - 11 - - 0.003922195655203699 + - 0.0159221956552037 - - 12 - - 0.004090842587659851 + - 0.016090842587659852 - - 13 - - 0.004271789175584172 + - 0.016271789175584174 - - 14 - - 0.004464466094067262 + - 0.01646446609406726 - - 15 - - 0.004668267110239981 + - 0.01666826711023998 - - 16 - - 0.004882550990706332 + - 0.016882550990706333 - - 17 - - 0.0051066435191009715 + - 0.017106643519100972 - - 18 - - 0.005339839617423317 + - 0.017339839617423317 - - 19 - - 0.005581405564473801 + - 0.017581405564473802 - - 20 - - 0.005830581304412209 + - 0.01783058130441221 - - 21 - - 0.006086582838174551 + - 0.01808658283817455 - - 22 - - 0.006348604690224164 + - 0.018348604690224164 - - 23 - - 0.006615822442875753 + - 0.018615822442875754 - - 24 - - 0.006887395330218428 + - 0.018887395330218427 - - 25 - - 0.007162468883476318 + - 0.01916246888347632 - - 26 - - 0.00744017761948346 + - 0.01944017761948346 - - 27 - - 0.007719647763814041 + - 0.01971964776381404 - - 28 - - 0.008 + - 0.02 - - 29 - - 0.00828035223618596 + - 0.02028035223618596 - - 30 - - 0.00855982238051654 + - 0.02055982238051654 - - 31 - - 0.008837531116523682 + - 0.020837531116523682 - - 32 - - 0.009112604669781572 + - 0.02111260466978157 - - 33 - - 0.009384177557124247 + - 0.021384177557124247 - - 34 - - 0.009651395309775834 + - 0.021651395309775834 - - 35 - - 0.00991341716182545 + - 0.02191341716182545 - - 36 - - 0.01016941869558779 + - 0.022169418695587792 - - 37 - - 0.010418594435526198 + - 0.0224185944355262 - - 38 - - 0.010660160382576682 + - 0.022660160382576684 - - 39 - - 0.010893356480899029 + - 0.02289335648089903 - - 40 - - 0.011117449009293668 + - 0.023117449009293668 - - 41 - - 0.01133173288976002 + - 0.02333173288976002 - - 42 - - 0.011535533905932737 + - 0.023535533905932736 - - 43 - - 0.011728210824415828 + - 0.023728210824415827 - - 44 - - 0.011909157412340148 + - 0.02390915741234015 - - 45 - - 0.0120778043447963 + - 0.0240778043447963 - - 46 - - 0.01223362099614142 + - 0.02423362099614142 - - 47 - - 0.012376117109543769 + - 0.02437611710954377 - - 48 - - 0.012504844339512097 + - 0.024504844339512097 - - 49 - - 0.012619397662556434 + - 0.024619397662556435 - - 50 - - 0.012719416651541839 + - 0.02471941665154184 - - 51 - - 0.012804586609725499 + - 0.0248045866097255 - - 52 - - 0.012874639560909118 + - 0.024874639560909118 - - 53 - - 0.01292935509259118 + - 0.024929355092591178 - - 54 - - 0.012968561049466212 + - 0.024968561049466213 - - 55 - - 0.012992134075089083 + - 0.024992134075089083 - - 56 - - 0.013000000000000001 + - 0.025 - - 57 - - 0.012992134075089083 + - 0.024992134075089083 - - 58 - - 0.012968561049466212 + - 0.024968561049466213 - - 59 - - 0.01292935509259118 + - 0.024929355092591178 - - 60 - - 0.012874639560909118 + - 0.024874639560909118 - - 61 - - 0.012804586609725499 + - 0.0248045866097255 - - 62 - - 0.012719416651541839 + - 0.02471941665154184 - - 63 - - 0.012619397662556434 + - 0.024619397662556435 - - 64 - - 0.012504844339512097 + - 0.024504844339512097 - - 65 - - 0.012376117109543769 + - 0.02437611710954377 - - 66 - - 0.012233620996141422 + - 0.024233620996141424 - - 67 - - 0.012077804344796302 + - 0.024077804344796304 - - 68 - - 0.011909157412340152 + - 0.023909157412340152 - - 69 - - 0.011728210824415828 + - 0.02372821082441583 - - 70 - - 0.01153553390593274 + - 0.02353553390593274 - - 71 - - 0.01133173288976002 + - 0.02333173288976002 - - 72 - - 0.011117449009293668 + - 0.023117449009293668 - - 73 - - 0.010893356480899029 + - 0.02289335648089903 - - 74 - - 0.010660160382576684 + - 0.022660160382576684 - - 75 - - 0.010418594435526202 + - 0.022418594435526202 - - 76 - - 0.010169418695587792 + - 0.022169418695587792 - - 77 - - 0.009913417161825451 + - 0.021913417161825453 - - 78 - - 0.009651395309775837 + - 0.021651395309775837 - - 79 - - 0.009384177557124247 + - 0.021384177557124247 - - 80 - - 0.009112604669781574 + - 0.021112604669781574 - - 81 - - 0.008837531116523686 + - 0.020837531116523686 - - 82 - - 0.00855982238051654 + - 0.02055982238051654 - - 83 - - 0.008280352236185957 + - 0.020280352236185958 - - 84 - - 0.008000000000000002 + - 0.02 - - 85 - - 0.007719647763814045 + - 0.019719647763814043 - - 86 - - 0.007440177619483462 + - 0.01944017761948346 - - 87 - - 0.007162468883476316 + - 0.01916246888347632 - - 88 - - 0.006887395330218429 + - 0.01888739533021843 - - 89 - - 0.006615822442875756 + - 0.018615822442875758 - - 90 - - 0.006348604690224166 + - 0.018348604690224167 - - 91 - - 0.00608658283817455 + - 0.01808658283817455 - - 92 - - 0.00583058130441221 + - 0.01783058130441221 - - 93 - - 0.0055814055644738 + - 0.0175814055644738 - - 94 - - 0.005339839617423318 + - 0.01733983961742332 - - 95 - - 0.005106643519100974 + - 0.017106643519100975 - - 96 - - 0.004882550990706333 + - 0.016882550990706333 - - 97 - - 0.004668267110239979 + - 0.01666826711023998 - - 98 - - 0.004464466094067263 + - 0.016464466094067265 - - 99 - - 0.004271789175584174 + - 0.016271789175584174 - - 100 - - 0.004090842587659851 + - 0.016090842587659852 - - 101 - - 0.0039221956552036984 + - 0.015922195655203697 - - 102 - - 0.0037663790038585804 + - 0.01576637900385858 - - 103 - - 0.003623882890456233 + - 0.015623882890456233 - - 104 - - 0.0034951556604879046 + - 0.015495155660487904 - - 105 - - 0.003380602337443568 + - 0.015380602337443568 - - 106 - - 0.0032805833484581626 + - 0.015280583348458162 - - 107 - - 0.003195413390274502 + - 0.015195413390274502 - - 108 - - 0.0031253604390908823 + - 0.015125360439090883 - - 109 - - 0.003070644907408821 + - 0.015070644907408821 - - 110 - - 0.003031438950533787 + - 0.015031438950533788 - - 111 - - 0.003007865924910917 + - 0.015007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +245,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.029541906819651888 + noise: 0.025134751494652507 proportion: 0.16 targets: leHavre_fra: - noise: 0.027174439537617754 + noise: 0.025432733187591285 proportion: 0.18755329471737509 montreal_can: - noise: 0.00980727387825093 + noise: 0.014981815264884504 proportion: 0.0756906048807678 newYork_usa: - noise: 0.0027637832634372895 + noise: 0.07860790872534353 proportion: 0.47933778254893905 pusan_kor: - noise: 0.014430384061284766 + noise: 0.002902145091237068 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.006930094460708154 + noise: 0.0016703057083900894 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.008742270235780183 + noise: 0.004329384963154748 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0011347602771777819 + noise: 0.00014700838968303593 proportion: 0.005882857005910926 yantian_chn: - noise: 0.006193414953469088 + noise: 0.014277274600949947 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +283,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012369701713498126 + noise: 0.0003905851406890507 proportion: 0.01 targets: qingdao_chn: - noise: 0.012364772365962309 + noise: 0.03386602700899302 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.00352215419270645 + noise: 0.04099351916502508 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.028599483759999704 + noise: 0.02983331512414685 proportion: 0.24812321657873454 yantian_chn: - noise: 0.04900330203859365 + noise: 0.0398838857119423 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +309,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0009621506996928753 + noise: 0.0017049012580563228 proportion: 0.01 targets: qingdao_chn: - noise: 0.026090492586688295 + noise: 0.006704071585248814 proportion: 0.19992517767067194 santos_bra: - noise: 0.012641742172183024 + noise: 0.01065215665926791 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.03176028945781009 + noise: 0.01889939427623029 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.009817528692331708 + noise: 0.030425501405892584 proportion: 0.19775168293424744 yantian_chn: - noise: 0.009621093160930289 + noise: 0.0038049637706619867 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +338,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.0018886517487191057 + noise: 0.010023093144315015 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.004315181577345305 + noise: 0.046713884416130814 proportion: 0.2613085269688243 montreal_can: - noise: 0.016843903962712903 + noise: 0.007011738109808054 proportion: 0.09474419644790176 newYork_usa: - noise: 0.009488796573182388 + noise: 0.0075575968616494 proportion: 0.20255309034522379 pusan_kor: - noise: 0.016473206464419552 + noise: 0.0022204132834372364 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.016694752769885985 + noise: 0.0025163323117031356 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.01034247956021821 + noise: 0.012253843912920523 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0017025555020105283 + noise: 0.014556815408633276 proportion: 0.07609945087001035 yantian_chn: - noise: 0.012420348270095348 + noise: 0.007509358525794673 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +376,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0010398317467610486 + noise: 0.007441531984981497 proportion: 0.05 targets: oakland_usa: - noise: 0.046610961242872055 + noise: 0.04265188459544233 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.0034681253869941176 + noise: 0.00273897680516611 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.021860225648515103 + noise: 0.01517255937598155 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04086143525071624 + noise: 0.014299850500812094 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.003862724565463262 + noise: 0.0051011672478115 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +405,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0076983570213705055 + noise: 0.005425915310841583 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0046065639504877355 + noise: 0.0073296927183103605 proportion: 0.1642819028757581 pusan_kor: - noise: 0.0025188189984588993 + noise: 0.018169915140256784 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.007167172404922409 + noise: 0.02383787277319661 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.004215477057755458 + noise: 0.0025563544317216205 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0015807008466467236 + noise: 0.02058384394808081 proportion: 0.11985637174894495 yantian_chn: - noise: 0.004717980724301031 + noise: 0.00989286132515691 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027332270387564594 + noise: 0.0007488162438248653 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +440,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.00041927575320429856 + noise: 0.0029979553756433923 proportion: 0.015 targets: singapore_sgp: - noise: 0.01720316773737656 + noise: 0.0566906410775888 proportion: 0.3293364398135728 sydney_aus: - noise: 0.0317483357682384 + noise: 0.01865388192132147 proportion: 0.3364188275147848 yantian_chn: - noise: 6.275255136458467e-05 + noise: 0.014238633997660635 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +463,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0001058824653549524 + noise: 0.0005621554647653919 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08372460982561138 + noise: 0.08779643369212999 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.005206377376346192 + noise: 0.07842477295179612 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +483,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0023971524264589056 + noise: 0.00016057717079772171 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.10416372800484693 + noise: 0.05981761122488196 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.05774414602239579 + noise: 0.03990533991720246 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +503,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.005226544429947875 + noise: 0.004910915544061917 proportion: 0.03 targets: losAngeles_usa: - noise: 0.054178562561998066 + noise: 0.048963812038470556 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.044477996162498444 + noise: 0.0254961817963097 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03359401622082758 + noise: 0.03349874892050399 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.04268416733729023 + noise: 0.012993114869682515 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +529,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029718257861642474 + noise: 0.0027667472862969076 proportion: 0.015 targets: losAngeles_usa: - noise: 0.008826102450863998 + noise: 0.05091486367601389 proportion: 0.2657898185062753 oakland_usa: - noise: 0.0011354503888720232 + noise: 0.028397329439457514 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.014679852245526353 + noise: 0.0016646658939369785 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.044867678747918735 + noise: 0.013742472852754001 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +555,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.002973353584364918 + noise: 0.009320427377742116 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.015482405581896957 + noise: 0.031991420231325084 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.0001302647468009758 + noise: 0.005105457599858164 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.010572876890368834 + noise: 0.005809147275802185 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0025256790825975454 + noise: 0.0033945457967072133 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.0010682303655455128 + noise: 0.001854192137165468 proportion: 0.035795894860646466 seattle_usa: - noise: 0.009613260507944536 + noise: 0.018330317944630015 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.0078571916664256 + noise: 0.009459052846765289 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0034843695558064575 + noise: 0.0016197423680226325 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00964564143149089 + noise: 0.00469787131269142 proportion: 0.059258114284493034 yantian_chn: - noise: 0.006902002888592339 + noise: 0.003856257701007031 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.011337884438636026 + noise: 0.014803870326138143 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +602,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.010033077426210528 + noise: 0.007181454765417904 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02614017182248326 + noise: 0.02952708760272511 proportion: 0.19166868266386958 durban_sau: - noise: 0.0017387242678691362 + noise: 0.0026860007722877676 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0003486452742150132 + noise: 0.0023058721270403397 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.009182092408099281 + noise: 0.008262798336030506 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.022644078007304263 + noise: 0.014599621251693524 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.0076428490407138075 + noise: 0.004578888771735588 proportion: 0.061252276599797005 oakland_usa: - noise: 0.00338044200189517 + noise: 0.0018968128853613635 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.0005795702643972235 + noise: 7.825075850514062e-05 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0034591090510660938 + noise: 0.0007151691535729856 proportion: 0.018577689927305203 santos_bra: - noise: 0.0019028622663675436 + noise: 0.0036806154087330586 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0022840751022966794 + noise: 0.0016116464454415448 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0013813896490110294 + noise: 0.0011503058311188963 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0014244818796804444 + noise: 0.0031091344585237185 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0026191834198310256 + noise: 0.0017512950798533396 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.003894234191508894 + noise: 0.023837737047619264 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +661,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012134052104793088 + noise: 0.0015229565945744795 proportion: 0.01 targets: manzanillo_mex: - noise: 0.012532297887460412 + noise: 0.029864110340333205 proportion: 0.1695702560614863 pusan_kor: - noise: 0.01302248526372375 + noise: 0.030434021872288986 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.005397619577307389 + noise: 0.031654173870326326 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.01679312314459858 + noise: 0.022840905205567065 proportion: 0.16105317774270345 yantian_chn: - noise: 0.019729642431771596 + noise: 0.022058626605590343 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.0055375795509528414 + noise: 0.020882193597463152 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +693,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.001877414087116521 + noise: 0.0017591918390130468 proportion: 0.01 targets: itagual_bra: - noise: 0.032004242821693965 + noise: 0.00015677478442405662 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.02033932536567358 + noise: 0.007951708444894913 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.03140598123730028 + noise: 0.008394529742993468 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01821241418824103 + noise: 0.01406059678653582 proportion: 0.19775168256638195 yantian_chn: - noise: 0.0026235148173812395 + noise: 0.011310434190498734 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +722,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.003107859253019168 + noise: 0.009178972285261822 proportion: 0.07 targets: losAngeles_usa: - noise: 0.05753073850487432 + noise: 0.023523817623575388 proportion: 0.2912736754142012 pusan_kor: - noise: 0.0016502073135337876 + noise: 0.01876947062956955 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.011314497001275887 + noise: 0.02029673306956859 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.005508132238408478 + noise: 0.011329185762784782 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.019332283176789165 + noise: 0.00024014816912197655 proportion: 0.09977785851511455 vancouver_can: - noise: 0.006127488353504421 + noise: 0.02057342705041732 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01754766809268637 + noise: 0.020083358186626803 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +757,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017095220699748878 + noise: 0.017109626305467616 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.041084325927985985 + noise: 0.021959106592952006 proportion: 0.21398371679064213 durban_sau: - noise: 0.0021696529552618954 + noise: 0.00010435314516980227 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0008030025073271739 + noise: 0.0020594969751376174 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0015848506299856926 + noise: 0.0009873199353313093 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.00755174044562672 + noise: 0.014743978442771179 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.011854629177267675 + noise: 0.0012374290703743276 proportion: 0.05976808154382374 oakland_usa: - noise: 0.028784906675318727 + noise: 0.022426459611386496 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0017948328245855443 + noise: 0.0005070099495173756 proportion: 0.00930596400725694 qingdao_chn: - noise: 0.000182985585552497 + noise: 1.8783239577936313e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0007693144229259965 + noise: 0.0012407696401487867 proportion: 0.011430536346128936 seattle_usa: - noise: 0.015979262018439678 + noise: 0.011299147787220907 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0006937704178989623 + noise: 0.002147321460772641 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0012210056169907513 + noise: 0.000883163479902347 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.010669005317136996 + noise: 0.012495339718107597 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +813,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0012836259212510967 + noise: 0.0014198451145378962 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02731130789420123 + noise: 0.02403294164090424 proportion: 0.16163465526933787 durban_sau: - noise: 0.0079917530205346 + noise: 0.007339857249890276 proportion: 0.052947229587582224 itagual_bra: - noise: 0.007301258651251609 + noise: 0.004826948332878951 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.0022920930271172033 + noise: 0.000697323478201817 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.000927122980718493 + noise: 0.009748446374379698 proportion: 0.054598902525719965 pusan_kor: - noise: 0.001481325232631238 + noise: 0.0052864459821632135 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0035672054884738702 + noise: 0.00020264478777542088 proportion: 0.04380756610509279 santos_bra: - noise: 0.0072911626019552455 + noise: 0.0060662606703405855 proportion: 0.0496114180206766 seattle_usa: - noise: 0.021977682321328896 + noise: 0.002184489196293904 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.006000301686369274 + noise: 0.00446890645579302 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.005118668874191572 + noise: 0.0005079804300151535 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0014991769548569809 + noise: 0.0032814259751614335 proportion: 0.053961624659387086 vancouver_can: - noise: 0.008355987327740363 + noise: 0.0013725415556900408 proportion: 0.04942443509903704 yantian_chn: - noise: 0.00424493151411591 + noise: 0.007866049277209214 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.023481573062834743 + noise: 0.013995694253814077 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +872,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002155120895930923 + noise: 5.318259543305715e-05 proportion: 0.015 targets: melbourne_aus: - noise: 0.043272556095345846 + noise: 0.010959524006592607 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.021150293369866142 + noise: 0.013378806626384264 proportion: 0.3291642505650358 yantian_chn: - noise: 0.032126637177988214 + noise: 0.043398566324619615 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +895,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.0017361691924081258 + noise: 0.002260078974868654 proportion: 0.02 targets: pusan_kor: - noise: 0.030070192002213465 + noise: 0.01022517907397126 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.0007756258463724296 + noise: 0.025111111836521687 proportion: 0.16078294599848347 seattle_usa: - noise: 0.034787830472740866 + noise: 0.025666860266381805 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.028936107345725295 + noise: 0.00391575019491024 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009484290050201566 + noise: 0.009869415376296499 proportion: 0.15641751563334233 yantian_chn: - noise: 0.0057514035358065966 + noise: 0.01646828787230074 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +927,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.008422256646885302 + noise: 0.005460106707641842 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.011723548393014914 + noise: 0.03183934815230198 proportion: 0.23063506921338092 durban_sau: - noise: 0.007028309982650573 + noise: 0.006955761417407662 proportion: 0.036977112629701755 itagual_bra: - noise: 0.0021232511744929236 + noise: 0.003879986047538319 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.01244233221440464 + noise: 0.0033746270986396783 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.005219875180760516 + noise: 0.014297914647911386 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.00325693140987167 + noise: 0.0055998037357593185 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0020033324939384353 + noise: 0.004337884540903886 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0024288519568081467 + noise: 0.0034845335834618927 proportion: 0.020692152164438926 santos_bra: - noise: 0.005917956078164042 + noise: 0.0023084677027446535 proportion: 0.03103337095193521 seattle_usa: - noise: 0.008224490506305046 + noise: 0.0043141199296154705 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0012713160693603898 + noise: 0.0001996474876791818 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0005993163297166358 + noise: 0.0011502086812016938 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003553789802863408 + noise: 0.0019319056238978993 proportion: 0.03878455068512264 vancouver_can: - noise: 0.005818365387463014 + noise: 0.0007858696914021227 proportion: 0.03070023678474206 yantian_chn: - noise: 0.000937390505729158 + noise: 0.0016168667042640794 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.0075575175422493215 + noise: 0.023246811699828965 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +989,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0008778537933683098 + noise: 0.014254332625813097 proportion: 0.08 targets: manzanillo_mex: - noise: 0.011810938798409994 + noise: 0.03244047063421112 proportion: 0.224773870587767 pusan_kor: - noise: 0.022595884352223653 + noise: 0.018126081484701975 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.024907581311612293 + noise: 0.017152304680050526 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.008287924815679014 + noise: 0.0003086488347039955 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0066037712087852 + noise: 0.0056287128415065625 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.016272909688446892 + noise: 0.019438990767313084 proportion: 0.1115894561579222 yantian_chn: - noise: 0.020166976986305943 + noise: 0.014838419143613479 proportion: 0.14697441091807414 routes: a3s: @@ -1159,17 +1163,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 928 + capacity: 696 parking: duration: 1 noise: 1 @@ -1180,7 +1180,7 @@ vessels: noise: 1 speed: 10 a3s_vessel_001: - capacity: 928 + capacity: 773 parking: duration: 1 noise: 1 @@ -1188,10 +1188,10 @@ vessels: initial_port_name: sydney_aus route_name: a3s sailing: - noise: 2 + noise: 1 speed: 10 asa_vessel_000: - capacity: 525 + capacity: 480 parking: duration: 1 noise: 1 @@ -1199,10 +1199,10 @@ vessels: initial_port_name: singapore_sgp route_name: asa sailing: - noise: 1 + noise: 2 speed: 10 asa_vessel_001: - capacity: 525 + capacity: 394 parking: duration: 1 noise: 1 @@ -1213,7 +1213,7 @@ vessels: noise: 1 speed: 10 ate1_vessel_000: - capacity: 5528 + capacity: 4606 parking: duration: 1 noise: 1 @@ -1224,7 +1224,7 @@ vessels: noise: 2 speed: 10 ate1_vessel_001: - capacity: 5528 + capacity: 5066 parking: duration: 1 noise: 1 @@ -1232,10 +1232,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ate1 sailing: - noise: 1 + noise: 2 speed: 10 gex1_vessel_000: - capacity: 1101 + capacity: 827 parking: duration: 1 noise: 1 @@ -1246,7 +1246,7 @@ vessels: noise: 2 speed: 10 gex1_vessel_001: - capacity: 1101 + capacity: 918 parking: duration: 1 noise: 1 @@ -1254,10 +1254,10 @@ vessels: initial_port_name: montreal_can route_name: gex1 sailing: - noise: 2 + noise: 1 speed: 10 ktx5_vessel_000: - capacity: 1359 + capacity: 1245 parking: duration: 1 noise: 1 @@ -1265,10 +1265,10 @@ vessels: initial_port_name: singapore_sgp route_name: ktx5 sailing: - noise: 2 + noise: 1 speed: 10 ktx5_vessel_001: - capacity: 1359 + capacity: 1019 parking: duration: 1 noise: 1 @@ -1276,10 +1276,10 @@ vessels: initial_port_name: yokohama_jpn route_name: ktx5 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_000: - capacity: 6339 + capacity: 5283 parking: duration: 1 noise: 1 @@ -1290,7 +1290,7 @@ vessels: noise: 1 speed: 10 ll4_vessel_001: - capacity: 6339 + capacity: 5811 parking: duration: 1 noise: 1 @@ -1298,10 +1298,10 @@ vessels: initial_port_name: yantian_chn route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_002: - capacity: 6339 + capacity: 4755 parking: duration: 1 noise: 1 @@ -1309,10 +1309,10 @@ vessels: initial_port_name: singapore_sgp route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_003: - capacity: 6339 + capacity: 5283 parking: duration: 1 noise: 1 @@ -1320,10 +1320,10 @@ vessels: initial_port_name: leHavre_fra route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 ll4_vessel_004: - capacity: 6339 + capacity: 5811 parking: duration: 1 noise: 1 @@ -1334,7 +1334,7 @@ vessels: noise: 2 speed: 10 ll4_vessel_005: - capacity: 6339 + capacity: 4755 parking: duration: 1 noise: 1 @@ -1342,10 +1342,10 @@ vessels: initial_port_name: qingdao_chn route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 10 pcc1_vessel_000: - capacity: 4725 + capacity: 3938 parking: duration: 1 noise: 1 @@ -1353,10 +1353,10 @@ vessels: initial_port_name: oakland_usa route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 10 pcc1_vessel_001: - capacity: 4725 + capacity: 4331 parking: duration: 1 noise: 1 @@ -1364,10 +1364,10 @@ vessels: initial_port_name: qingdao_chn route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 10 pcc1_vessel_002: - capacity: 4725 + capacity: 3545 parking: duration: 1 noise: 1 @@ -1375,10 +1375,10 @@ vessels: initial_port_name: princeRupert_can route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 10 pcc2_vessel_000: - capacity: 2346 + capacity: 1955 parking: duration: 1 noise: 1 @@ -1386,10 +1386,10 @@ vessels: initial_port_name: seattle_usa route_name: pcc2 sailing: - noise: 1 + noise: 2 speed: 10 pcc2_vessel_001: - capacity: 2346 + capacity: 2150 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 10 pcc2_vessel_002: - capacity: 2346 + capacity: 1760 parking: duration: 1 noise: 1 @@ -1408,10 +1408,10 @@ vessels: initial_port_name: shanghai_chn route_name: pcc2 sailing: - noise: 2 + noise: 1 speed: 10 pnw1_vessel_000: - capacity: 2044 + capacity: 1703 parking: duration: 1 noise: 1 @@ -1419,10 +1419,10 @@ vessels: initial_port_name: seattle_usa route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 10 pnw1_vessel_001: - capacity: 2044 + capacity: 1873 parking: duration: 1 noise: 1 @@ -1430,10 +1430,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw1 sailing: - noise: 1 + noise: 2 speed: 10 pnw1_vessel_002: - capacity: 2044 + capacity: 1533 parking: duration: 1 noise: 1 @@ -1444,7 +1444,7 @@ vessels: noise: 2 speed: 10 pnw2_vessel_000: - capacity: 861 + capacity: 717 parking: duration: 1 noise: 1 @@ -1455,7 +1455,7 @@ vessels: noise: 1 speed: 10 pnw2_vessel_001: - capacity: 861 + capacity: 788 parking: duration: 1 noise: 1 @@ -1463,10 +1463,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_002: - capacity: 861 + capacity: 646 parking: duration: 1 noise: 1 @@ -1474,10 +1474,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_003: - capacity: 861 + capacity: 717 parking: duration: 1 noise: 1 @@ -1488,7 +1488,7 @@ vessels: noise: 2 speed: 10 pnw2_vessel_004: - capacity: 861 + capacity: 788 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_000: - capacity: 621 + capacity: 466 parking: duration: 1 noise: 1 @@ -1507,10 +1507,10 @@ vessels: initial_port_name: yantian_chn route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 saf3_vessel_001: - capacity: 621 + capacity: 517 parking: duration: 1 noise: 1 @@ -1521,7 +1521,7 @@ vessels: noise: 1 speed: 10 saf3_vessel_002: - capacity: 621 + capacity: 568 parking: duration: 1 noise: 1 @@ -1529,10 +1529,10 @@ vessels: initial_port_name: singapore_sgp route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 saf3_vessel_003: - capacity: 621 + capacity: 466 parking: duration: 1 noise: 1 @@ -1540,10 +1540,10 @@ vessels: initial_port_name: durban_sau route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_000: - capacity: 1137 + capacity: 948 parking: duration: 1 noise: 1 @@ -1554,7 +1554,7 @@ vessels: noise: 2 speed: 10 tla2_vessel_001: - capacity: 1137 + capacity: 1042 parking: duration: 1 noise: 1 @@ -1562,10 +1562,10 @@ vessels: initial_port_name: santos_bra route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_002: - capacity: 1137 + capacity: 854 parking: duration: 1 noise: 1 @@ -1573,10 +1573,10 @@ vessels: initial_port_name: singapore_sgp route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_003: - capacity: 1137 + capacity: 948 parking: duration: 1 noise: 1 @@ -1584,10 +1584,10 @@ vessels: initial_port_name: shanghai_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 10 tla2_vessel_004: - capacity: 1137 + capacity: 1042 parking: duration: 1 noise: 1 @@ -1598,7 +1598,7 @@ vessels: noise: 1 speed: 10 tla2_vessel_005: - capacity: 1137 + capacity: 854 parking: duration: 1 noise: 1 @@ -1609,7 +1609,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_000: - capacity: 6079 + capacity: 5066 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_001: - capacity: 6079 + capacity: 5572 parking: duration: 1 noise: 1 @@ -1628,10 +1628,10 @@ vessels: initial_port_name: manzanillo_mex route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 10 tlp1_vessel_002: - capacity: 6079 + capacity: 4560 parking: duration: 1 noise: 1 @@ -1639,10 +1639,10 @@ vessels: initial_port_name: pusan_kor route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 10 tlp1_vessel_003: - capacity: 6079 + capacity: 5066 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 10 tlp1_vessel_004: - capacity: 6079 + capacity: 5572 parking: duration: 1 noise: 1 @@ -1661,10 +1661,10 @@ vessels: initial_port_name: sanAntonio_par route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 10 tlp1_vessel_005: - capacity: 6079 + capacity: 4560 parking: duration: 1 noise: 1 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml index 2558505e9..95c1a90ce 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.7/config.yml @@ -1,230 +1,234 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.003 + - 0.015 - - 1 - - 0.003007865924910917 + - 0.015007865924910917 - - 2 - - 0.003031438950533787 + - 0.015031438950533788 - - 3 - - 0.003070644907408821 + - 0.015070644907408821 - - 4 - - 0.0031253604390908823 + - 0.015125360439090883 - - 5 - - 0.003195413390274502 + - 0.015195413390274502 - - 6 - - 0.0032805833484581626 + - 0.015280583348458162 - - 7 - - 0.003380602337443566 + - 0.015380602337443566 - - 8 - - 0.0034951556604879046 + - 0.015495155660487904 - - 9 - - 0.0036238828904562315 + - 0.015623882890456232 - - 10 - - 0.0037663790038585795 + - 0.015766379003858577 - - 11 - - 0.003922195655203699 + - 0.0159221956552037 - - 12 - - 0.004090842587659851 + - 0.016090842587659852 - - 13 - - 0.004271789175584172 + - 0.016271789175584174 - - 14 - - 0.004464466094067262 + - 0.01646446609406726 - - 15 - - 0.004668267110239981 + - 0.01666826711023998 - - 16 - - 0.004882550990706332 + - 0.016882550990706333 - - 17 - - 0.0051066435191009715 + - 0.017106643519100972 - - 18 - - 0.005339839617423317 + - 0.017339839617423317 - - 19 - - 0.005581405564473801 + - 0.017581405564473802 - - 20 - - 0.005830581304412209 + - 0.01783058130441221 - - 21 - - 0.006086582838174551 + - 0.01808658283817455 - - 22 - - 0.006348604690224164 + - 0.018348604690224164 - - 23 - - 0.006615822442875753 + - 0.018615822442875754 - - 24 - - 0.006887395330218428 + - 0.018887395330218427 - - 25 - - 0.007162468883476318 + - 0.01916246888347632 - - 26 - - 0.00744017761948346 + - 0.01944017761948346 - - 27 - - 0.007719647763814041 + - 0.01971964776381404 - - 28 - - 0.008 + - 0.02 - - 29 - - 0.00828035223618596 + - 0.02028035223618596 - - 30 - - 0.00855982238051654 + - 0.02055982238051654 - - 31 - - 0.008837531116523682 + - 0.020837531116523682 - - 32 - - 0.009112604669781572 + - 0.02111260466978157 - - 33 - - 0.009384177557124247 + - 0.021384177557124247 - - 34 - - 0.009651395309775834 + - 0.021651395309775834 - - 35 - - 0.00991341716182545 + - 0.02191341716182545 - - 36 - - 0.01016941869558779 + - 0.022169418695587792 - - 37 - - 0.010418594435526198 + - 0.0224185944355262 - - 38 - - 0.010660160382576682 + - 0.022660160382576684 - - 39 - - 0.010893356480899029 + - 0.02289335648089903 - - 40 - - 0.011117449009293668 + - 0.023117449009293668 - - 41 - - 0.01133173288976002 + - 0.02333173288976002 - - 42 - - 0.011535533905932737 + - 0.023535533905932736 - - 43 - - 0.011728210824415828 + - 0.023728210824415827 - - 44 - - 0.011909157412340148 + - 0.02390915741234015 - - 45 - - 0.0120778043447963 + - 0.0240778043447963 - - 46 - - 0.01223362099614142 + - 0.02423362099614142 - - 47 - - 0.012376117109543769 + - 0.02437611710954377 - - 48 - - 0.012504844339512097 + - 0.024504844339512097 - - 49 - - 0.012619397662556434 + - 0.024619397662556435 - - 50 - - 0.012719416651541839 + - 0.02471941665154184 - - 51 - - 0.012804586609725499 + - 0.0248045866097255 - - 52 - - 0.012874639560909118 + - 0.024874639560909118 - - 53 - - 0.01292935509259118 + - 0.024929355092591178 - - 54 - - 0.012968561049466212 + - 0.024968561049466213 - - 55 - - 0.012992134075089083 + - 0.024992134075089083 - - 56 - - 0.013000000000000001 + - 0.025 - - 57 - - 0.012992134075089083 + - 0.024992134075089083 - - 58 - - 0.012968561049466212 + - 0.024968561049466213 - - 59 - - 0.01292935509259118 + - 0.024929355092591178 - - 60 - - 0.012874639560909118 + - 0.024874639560909118 - - 61 - - 0.012804586609725499 + - 0.0248045866097255 - - 62 - - 0.012719416651541839 + - 0.02471941665154184 - - 63 - - 0.012619397662556434 + - 0.024619397662556435 - - 64 - - 0.012504844339512097 + - 0.024504844339512097 - - 65 - - 0.012376117109543769 + - 0.02437611710954377 - - 66 - - 0.012233620996141422 + - 0.024233620996141424 - - 67 - - 0.012077804344796302 + - 0.024077804344796304 - - 68 - - 0.011909157412340152 + - 0.023909157412340152 - - 69 - - 0.011728210824415828 + - 0.02372821082441583 - - 70 - - 0.01153553390593274 + - 0.02353553390593274 - - 71 - - 0.01133173288976002 + - 0.02333173288976002 - - 72 - - 0.011117449009293668 + - 0.023117449009293668 - - 73 - - 0.010893356480899029 + - 0.02289335648089903 - - 74 - - 0.010660160382576684 + - 0.022660160382576684 - - 75 - - 0.010418594435526202 + - 0.022418594435526202 - - 76 - - 0.010169418695587792 + - 0.022169418695587792 - - 77 - - 0.009913417161825451 + - 0.021913417161825453 - - 78 - - 0.009651395309775837 + - 0.021651395309775837 - - 79 - - 0.009384177557124247 + - 0.021384177557124247 - - 80 - - 0.009112604669781574 + - 0.021112604669781574 - - 81 - - 0.008837531116523686 + - 0.020837531116523686 - - 82 - - 0.00855982238051654 + - 0.02055982238051654 - - 83 - - 0.008280352236185957 + - 0.020280352236185958 - - 84 - - 0.008000000000000002 + - 0.02 - - 85 - - 0.007719647763814045 + - 0.019719647763814043 - - 86 - - 0.007440177619483462 + - 0.01944017761948346 - - 87 - - 0.007162468883476316 + - 0.01916246888347632 - - 88 - - 0.006887395330218429 + - 0.01888739533021843 - - 89 - - 0.006615822442875756 + - 0.018615822442875758 - - 90 - - 0.006348604690224166 + - 0.018348604690224167 - - 91 - - 0.00608658283817455 + - 0.01808658283817455 - - 92 - - 0.00583058130441221 + - 0.01783058130441221 - - 93 - - 0.0055814055644738 + - 0.0175814055644738 - - 94 - - 0.005339839617423318 + - 0.01733983961742332 - - 95 - - 0.005106643519100974 + - 0.017106643519100975 - - 96 - - 0.004882550990706333 + - 0.016882550990706333 - - 97 - - 0.004668267110239979 + - 0.01666826711023998 - - 98 - - 0.004464466094067263 + - 0.016464466094067265 - - 99 - - 0.004271789175584174 + - 0.016271789175584174 - - 100 - - 0.004090842587659851 + - 0.016090842587659852 - - 101 - - 0.0039221956552036984 + - 0.015922195655203697 - - 102 - - 0.0037663790038585804 + - 0.01576637900385858 - - 103 - - 0.003623882890456233 + - 0.015623882890456233 - - 104 - - 0.0034951556604879046 + - 0.015495155660487904 - - 105 - - 0.003380602337443568 + - 0.015380602337443568 - - 106 - - 0.0032805833484581626 + - 0.015280583348458162 - - 107 - - 0.003195413390274502 + - 0.015195413390274502 - - 108 - - 0.0031253604390908823 + - 0.015125360439090883 - - 109 - - 0.003070644907408821 + - 0.015070644907408821 - - 110 - - 0.003031438950533787 + - 0.015031438950533788 - - 111 - - 0.003007865924910917 + - 0.015007865924910917 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +245,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.029541906819651888 + noise: 0.025134751494652507 proportion: 0.16 targets: leHavre_fra: - noise: 0.027174439537617754 + noise: 0.025432733187591285 proportion: 0.18755329471737509 montreal_can: - noise: 0.00980727387825093 + noise: 0.014981815264884504 proportion: 0.0756906048807678 newYork_usa: - noise: 0.0027637832634372895 + noise: 0.07860790872534353 proportion: 0.47933778254893905 pusan_kor: - noise: 0.014430384061284766 + noise: 0.002902145091237068 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.006930094460708154 + noise: 0.0016703057083900894 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.008742270235780183 + noise: 0.004329384963154748 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0011347602771777819 + noise: 0.00014700838968303593 proportion: 0.005882857005910926 yantian_chn: - noise: 0.006193414953469088 + noise: 0.014277274600949947 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +283,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012369701713498126 + noise: 0.0003905851406890507 proportion: 0.01 targets: qingdao_chn: - noise: 0.012364772365962309 + noise: 0.03386602700899302 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.00352215419270645 + noise: 0.04099351916502508 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.028599483759999704 + noise: 0.02983331512414685 proportion: 0.24812321657873454 yantian_chn: - noise: 0.04900330203859365 + noise: 0.0398838857119423 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +309,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0009621506996928753 + noise: 0.0017049012580563228 proportion: 0.01 targets: qingdao_chn: - noise: 0.026090492586688295 + noise: 0.006704071585248814 proportion: 0.19992517767067194 santos_bra: - noise: 0.012641742172183024 + noise: 0.01065215665926791 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.03176028945781009 + noise: 0.01889939427623029 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.009817528692331708 + noise: 0.030425501405892584 proportion: 0.19775168293424744 yantian_chn: - noise: 0.009621093160930289 + noise: 0.0038049637706619867 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +338,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.0018886517487191057 + noise: 0.010023093144315015 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.004315181577345305 + noise: 0.046713884416130814 proportion: 0.2613085269688243 montreal_can: - noise: 0.016843903962712903 + noise: 0.007011738109808054 proportion: 0.09474419644790176 newYork_usa: - noise: 0.009488796573182388 + noise: 0.0075575968616494 proportion: 0.20255309034522379 pusan_kor: - noise: 0.016473206464419552 + noise: 0.0022204132834372364 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.016694752769885985 + noise: 0.0025163323117031356 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.01034247956021821 + noise: 0.012253843912920523 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0017025555020105283 + noise: 0.014556815408633276 proportion: 0.07609945087001035 yantian_chn: - noise: 0.012420348270095348 + noise: 0.007509358525794673 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +376,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0010398317467610486 + noise: 0.007441531984981497 proportion: 0.05 targets: oakland_usa: - noise: 0.046610961242872055 + noise: 0.04265188459544233 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.0034681253869941176 + noise: 0.00273897680516611 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.021860225648515103 + noise: 0.01517255937598155 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04086143525071624 + noise: 0.014299850500812094 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.003862724565463262 + noise: 0.0051011672478115 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +405,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0076983570213705055 + noise: 0.005425915310841583 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0046065639504877355 + noise: 0.0073296927183103605 proportion: 0.1642819028757581 pusan_kor: - noise: 0.0025188189984588993 + noise: 0.018169915140256784 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.007167172404922409 + noise: 0.02383787277319661 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.004215477057755458 + noise: 0.0025563544317216205 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0015807008466467236 + noise: 0.02058384394808081 proportion: 0.11985637174894495 yantian_chn: - noise: 0.004717980724301031 + noise: 0.00989286132515691 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027332270387564594 + noise: 0.0007488162438248653 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +440,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.00041927575320429856 + noise: 0.0029979553756433923 proportion: 0.015 targets: singapore_sgp: - noise: 0.01720316773737656 + noise: 0.0566906410775888 proportion: 0.3293364398135728 sydney_aus: - noise: 0.0317483357682384 + noise: 0.01865388192132147 proportion: 0.3364188275147848 yantian_chn: - noise: 6.275255136458467e-05 + noise: 0.014238633997660635 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +463,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0001058824653549524 + noise: 0.0005621554647653919 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08372460982561138 + noise: 0.08779643369212999 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.005206377376346192 + noise: 0.07842477295179612 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +483,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0023971524264589056 + noise: 0.00016057717079772171 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.10416372800484693 + noise: 0.05981761122488196 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.05774414602239579 + noise: 0.03990533991720246 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +503,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.005226544429947875 + noise: 0.004910915544061917 proportion: 0.03 targets: losAngeles_usa: - noise: 0.054178562561998066 + noise: 0.048963812038470556 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.044477996162498444 + noise: 0.0254961817963097 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03359401622082758 + noise: 0.03349874892050399 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.04268416733729023 + noise: 0.012993114869682515 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +529,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029718257861642474 + noise: 0.0027667472862969076 proportion: 0.015 targets: losAngeles_usa: - noise: 0.008826102450863998 + noise: 0.05091486367601389 proportion: 0.2657898185062753 oakland_usa: - noise: 0.0011354503888720232 + noise: 0.028397329439457514 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.014679852245526353 + noise: 0.0016646658939369785 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.044867678747918735 + noise: 0.013742472852754001 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +555,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.002973353584364918 + noise: 0.009320427377742116 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.015482405581896957 + noise: 0.031991420231325084 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.0001302647468009758 + noise: 0.005105457599858164 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.010572876890368834 + noise: 0.005809147275802185 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0025256790825975454 + noise: 0.0033945457967072133 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.0010682303655455128 + noise: 0.001854192137165468 proportion: 0.035795894860646466 seattle_usa: - noise: 0.009613260507944536 + noise: 0.018330317944630015 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.0078571916664256 + noise: 0.009459052846765289 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0034843695558064575 + noise: 0.0016197423680226325 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00964564143149089 + noise: 0.00469787131269142 proportion: 0.059258114284493034 yantian_chn: - noise: 0.006902002888592339 + noise: 0.003856257701007031 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.011337884438636026 + noise: 0.014803870326138143 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +602,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.010033077426210528 + noise: 0.007181454765417904 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02614017182248326 + noise: 0.02952708760272511 proportion: 0.19166868266386958 durban_sau: - noise: 0.0017387242678691362 + noise: 0.0026860007722877676 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0003486452742150132 + noise: 0.0023058721270403397 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.009182092408099281 + noise: 0.008262798336030506 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.022644078007304263 + noise: 0.014599621251693524 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.0076428490407138075 + noise: 0.004578888771735588 proportion: 0.061252276599797005 oakland_usa: - noise: 0.00338044200189517 + noise: 0.0018968128853613635 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.0005795702643972235 + noise: 7.825075850514062e-05 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0034591090510660938 + noise: 0.0007151691535729856 proportion: 0.018577689927305203 santos_bra: - noise: 0.0019028622663675436 + noise: 0.0036806154087330586 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0022840751022966794 + noise: 0.0016116464454415448 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0013813896490110294 + noise: 0.0011503058311188963 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0014244818796804444 + noise: 0.0031091344585237185 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0026191834198310256 + noise: 0.0017512950798533396 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.003894234191508894 + noise: 0.023837737047619264 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +661,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012134052104793088 + noise: 0.0015229565945744795 proportion: 0.01 targets: manzanillo_mex: - noise: 0.012532297887460412 + noise: 0.029864110340333205 proportion: 0.1695702560614863 pusan_kor: - noise: 0.01302248526372375 + noise: 0.030434021872288986 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.005397619577307389 + noise: 0.031654173870326326 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.01679312314459858 + noise: 0.022840905205567065 proportion: 0.16105317774270345 yantian_chn: - noise: 0.019729642431771596 + noise: 0.022058626605590343 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.0055375795509528414 + noise: 0.020882193597463152 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +693,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.001877414087116521 + noise: 0.0017591918390130468 proportion: 0.01 targets: itagual_bra: - noise: 0.032004242821693965 + noise: 0.00015677478442405662 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.02033932536567358 + noise: 0.007951708444894913 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.03140598123730028 + noise: 0.008394529742993468 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01821241418824103 + noise: 0.01406059678653582 proportion: 0.19775168256638195 yantian_chn: - noise: 0.0026235148173812395 + noise: 0.011310434190498734 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +722,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.003107859253019168 + noise: 0.009178972285261822 proportion: 0.07 targets: losAngeles_usa: - noise: 0.05753073850487432 + noise: 0.023523817623575388 proportion: 0.2912736754142012 pusan_kor: - noise: 0.0016502073135337876 + noise: 0.01876947062956955 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.011314497001275887 + noise: 0.02029673306956859 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.005508132238408478 + noise: 0.011329185762784782 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.019332283176789165 + noise: 0.00024014816912197655 proportion: 0.09977785851511455 vancouver_can: - noise: 0.006127488353504421 + noise: 0.02057342705041732 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01754766809268637 + noise: 0.020083358186626803 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +757,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017095220699748878 + noise: 0.017109626305467616 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.041084325927985985 + noise: 0.021959106592952006 proportion: 0.21398371679064213 durban_sau: - noise: 0.0021696529552618954 + noise: 0.00010435314516980227 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0008030025073271739 + noise: 0.0020594969751376174 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0015848506299856926 + noise: 0.0009873199353313093 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.00755174044562672 + noise: 0.014743978442771179 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.011854629177267675 + noise: 0.0012374290703743276 proportion: 0.05976808154382374 oakland_usa: - noise: 0.028784906675318727 + noise: 0.022426459611386496 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0017948328245855443 + noise: 0.0005070099495173756 proportion: 0.00930596400725694 qingdao_chn: - noise: 0.000182985585552497 + noise: 1.8783239577936313e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0007693144229259965 + noise: 0.0012407696401487867 proportion: 0.011430536346128936 seattle_usa: - noise: 0.015979262018439678 + noise: 0.011299147787220907 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0006937704178989623 + noise: 0.002147321460772641 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0012210056169907513 + noise: 0.000883163479902347 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.010669005317136996 + noise: 0.012495339718107597 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +813,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0012836259212510967 + noise: 0.0014198451145378962 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02731130789420123 + noise: 0.02403294164090424 proportion: 0.16163465526933787 durban_sau: - noise: 0.0079917530205346 + noise: 0.007339857249890276 proportion: 0.052947229587582224 itagual_bra: - noise: 0.007301258651251609 + noise: 0.004826948332878951 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.0022920930271172033 + noise: 0.000697323478201817 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.000927122980718493 + noise: 0.009748446374379698 proportion: 0.054598902525719965 pusan_kor: - noise: 0.001481325232631238 + noise: 0.0052864459821632135 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0035672054884738702 + noise: 0.00020264478777542088 proportion: 0.04380756610509279 santos_bra: - noise: 0.0072911626019552455 + noise: 0.0060662606703405855 proportion: 0.0496114180206766 seattle_usa: - noise: 0.021977682321328896 + noise: 0.002184489196293904 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.006000301686369274 + noise: 0.00446890645579302 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.005118668874191572 + noise: 0.0005079804300151535 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0014991769548569809 + noise: 0.0032814259751614335 proportion: 0.053961624659387086 vancouver_can: - noise: 0.008355987327740363 + noise: 0.0013725415556900408 proportion: 0.04942443509903704 yantian_chn: - noise: 0.00424493151411591 + noise: 0.007866049277209214 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.023481573062834743 + noise: 0.013995694253814077 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +872,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002155120895930923 + noise: 5.318259543305715e-05 proportion: 0.015 targets: melbourne_aus: - noise: 0.043272556095345846 + noise: 0.010959524006592607 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.021150293369866142 + noise: 0.013378806626384264 proportion: 0.3291642505650358 yantian_chn: - noise: 0.032126637177988214 + noise: 0.043398566324619615 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +895,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.0017361691924081258 + noise: 0.002260078974868654 proportion: 0.02 targets: pusan_kor: - noise: 0.030070192002213465 + noise: 0.01022517907397126 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.0007756258463724296 + noise: 0.025111111836521687 proportion: 0.16078294599848347 seattle_usa: - noise: 0.034787830472740866 + noise: 0.025666860266381805 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.028936107345725295 + noise: 0.00391575019491024 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009484290050201566 + noise: 0.009869415376296499 proportion: 0.15641751563334233 yantian_chn: - noise: 0.0057514035358065966 + noise: 0.01646828787230074 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +927,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.008422256646885302 + noise: 0.005460106707641842 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.011723548393014914 + noise: 0.03183934815230198 proportion: 0.23063506921338092 durban_sau: - noise: 0.007028309982650573 + noise: 0.006955761417407662 proportion: 0.036977112629701755 itagual_bra: - noise: 0.0021232511744929236 + noise: 0.003879986047538319 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.01244233221440464 + noise: 0.0033746270986396783 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.005219875180760516 + noise: 0.014297914647911386 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.00325693140987167 + noise: 0.0055998037357593185 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0020033324939384353 + noise: 0.004337884540903886 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0024288519568081467 + noise: 0.0034845335834618927 proportion: 0.020692152164438926 santos_bra: - noise: 0.005917956078164042 + noise: 0.0023084677027446535 proportion: 0.03103337095193521 seattle_usa: - noise: 0.008224490506305046 + noise: 0.0043141199296154705 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0012713160693603898 + noise: 0.0001996474876791818 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0005993163297166358 + noise: 0.0011502086812016938 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003553789802863408 + noise: 0.0019319056238978993 proportion: 0.03878455068512264 vancouver_can: - noise: 0.005818365387463014 + noise: 0.0007858696914021227 proportion: 0.03070023678474206 yantian_chn: - noise: 0.000937390505729158 + noise: 0.0016168667042640794 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.0075575175422493215 + noise: 0.023246811699828965 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +989,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0008778537933683098 + noise: 0.014254332625813097 proportion: 0.08 targets: manzanillo_mex: - noise: 0.011810938798409994 + noise: 0.03244047063421112 proportion: 0.224773870587767 pusan_kor: - noise: 0.022595884352223653 + noise: 0.018126081484701975 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.024907581311612293 + noise: 0.017152304680050526 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.008287924815679014 + noise: 0.0003086488347039955 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0066037712087852 + noise: 0.0056287128415065625 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.016272909688446892 + noise: 0.019438990767313084 proportion: 0.1115894561579222 yantian_chn: - noise: 0.020166976986305943 + noise: 0.014838419143613479 proportion: 0.14697441091807414 routes: a3s: @@ -1159,17 +1163,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 928 + capacity: 871 parking: duration: 1 noise: 1 @@ -1177,10 +1177,10 @@ vessels: initial_port_name: yantian_chn route_name: a3s sailing: - noise: 1 + noise: 2 speed: 10 a3s_vessel_001: - capacity: 928 + capacity: 967 parking: duration: 1 noise: 1 @@ -1191,7 +1191,7 @@ vessels: noise: 2 speed: 9 asa_vessel_000: - capacity: 525 + capacity: 601 parking: duration: 1 noise: 1 @@ -1202,7 +1202,7 @@ vessels: noise: 1 speed: 8 asa_vessel_001: - capacity: 525 + capacity: 493 parking: duration: 1 noise: 1 @@ -1210,10 +1210,10 @@ vessels: initial_port_name: melbourne_aus route_name: asa sailing: - noise: 1 + noise: 2 speed: 10 ate1_vessel_000: - capacity: 5528 + capacity: 5758 parking: duration: 1 noise: 1 @@ -1221,10 +1221,10 @@ vessels: initial_port_name: newYork_usa route_name: ate1 sailing: - noise: 2 + noise: 1 speed: 9 ate1_vessel_001: - capacity: 5528 + capacity: 6333 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 8 gex1_vessel_000: - capacity: 1101 + capacity: 1033 parking: duration: 1 noise: 1 @@ -1246,7 +1246,7 @@ vessels: noise: 2 speed: 10 gex1_vessel_001: - capacity: 1101 + capacity: 1147 parking: duration: 1 noise: 1 @@ -1254,10 +1254,10 @@ vessels: initial_port_name: montreal_can route_name: gex1 sailing: - noise: 2 + noise: 1 speed: 9 ktx5_vessel_000: - capacity: 1359 + capacity: 1557 parking: duration: 1 noise: 1 @@ -1265,10 +1265,10 @@ vessels: initial_port_name: singapore_sgp route_name: ktx5 sailing: - noise: 2 + noise: 1 speed: 8 ktx5_vessel_001: - capacity: 1359 + capacity: 1275 parking: duration: 1 noise: 1 @@ -1276,10 +1276,10 @@ vessels: initial_port_name: yokohama_jpn route_name: ktx5 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_000: - capacity: 6339 + capacity: 6603 parking: duration: 1 noise: 1 @@ -1287,10 +1287,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 9 ll4_vessel_001: - capacity: 6339 + capacity: 7263 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_002: - capacity: 6339 + capacity: 5943 parking: duration: 1 noise: 1 @@ -1312,7 +1312,7 @@ vessels: noise: 1 speed: 10 ll4_vessel_003: - capacity: 6339 + capacity: 6603 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 9 ll4_vessel_004: - capacity: 6339 + capacity: 7263 parking: duration: 1 noise: 1 @@ -1331,10 +1331,10 @@ vessels: initial_port_name: pusan_kor route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 8 ll4_vessel_005: - capacity: 6339 + capacity: 5943 parking: duration: 1 noise: 1 @@ -1345,7 +1345,7 @@ vessels: noise: 1 speed: 10 pcc1_vessel_000: - capacity: 4725 + capacity: 4922 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 9 pcc1_vessel_001: - capacity: 4725 + capacity: 5414 parking: duration: 1 noise: 1 @@ -1364,10 +1364,10 @@ vessels: initial_port_name: qingdao_chn route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 8 pcc1_vessel_002: - capacity: 4725 + capacity: 4430 parking: duration: 1 noise: 1 @@ -1378,7 +1378,7 @@ vessels: noise: 1 speed: 10 pcc2_vessel_000: - capacity: 2346 + capacity: 2443 parking: duration: 1 noise: 1 @@ -1386,10 +1386,10 @@ vessels: initial_port_name: seattle_usa route_name: pcc2 sailing: - noise: 1 + noise: 2 speed: 9 pcc2_vessel_001: - capacity: 2346 + capacity: 2687 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 8 pcc2_vessel_002: - capacity: 2346 + capacity: 2199 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 2044 + capacity: 2129 parking: duration: 1 noise: 1 @@ -1419,10 +1419,10 @@ vessels: initial_port_name: seattle_usa route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 9 pnw1_vessel_001: - capacity: 2044 + capacity: 2341 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 8 pnw1_vessel_002: - capacity: 2044 + capacity: 1917 parking: duration: 1 noise: 1 @@ -1441,10 +1441,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_000: - capacity: 861 + capacity: 897 parking: duration: 1 noise: 1 @@ -1452,10 +1452,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 9 pnw2_vessel_001: - capacity: 861 + capacity: 986 parking: duration: 1 noise: 1 @@ -1466,7 +1466,7 @@ vessels: noise: 2 speed: 8 pnw2_vessel_002: - capacity: 861 + capacity: 808 parking: duration: 1 noise: 1 @@ -1474,10 +1474,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_003: - capacity: 861 + capacity: 897 parking: duration: 1 noise: 1 @@ -1485,10 +1485,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 9 pnw2_vessel_004: - capacity: 861 + capacity: 986 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 8 saf3_vessel_000: - capacity: 621 + capacity: 583 parking: duration: 1 noise: 1 @@ -1507,10 +1507,10 @@ vessels: initial_port_name: yantian_chn route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 saf3_vessel_001: - capacity: 621 + capacity: 647 parking: duration: 1 noise: 1 @@ -1521,7 +1521,7 @@ vessels: noise: 1 speed: 9 saf3_vessel_002: - capacity: 621 + capacity: 711 parking: duration: 1 noise: 1 @@ -1532,7 +1532,7 @@ vessels: noise: 2 speed: 8 saf3_vessel_003: - capacity: 621 + capacity: 583 parking: duration: 1 noise: 1 @@ -1543,7 +1543,7 @@ vessels: noise: 2 speed: 10 tla2_vessel_000: - capacity: 1137 + capacity: 1185 parking: duration: 1 noise: 1 @@ -1551,10 +1551,10 @@ vessels: initial_port_name: itagual_bra route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 9 tla2_vessel_001: - capacity: 1137 + capacity: 1303 parking: duration: 1 noise: 1 @@ -1562,10 +1562,10 @@ vessels: initial_port_name: santos_bra route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 8 tla2_vessel_002: - capacity: 1137 + capacity: 1067 parking: duration: 1 noise: 1 @@ -1573,10 +1573,10 @@ vessels: initial_port_name: singapore_sgp route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_003: - capacity: 1137 + capacity: 1185 parking: duration: 1 noise: 1 @@ -1584,10 +1584,10 @@ vessels: initial_port_name: shanghai_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 9 tla2_vessel_004: - capacity: 1137 + capacity: 1303 parking: duration: 1 noise: 1 @@ -1595,10 +1595,10 @@ vessels: initial_port_name: qingdao_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 8 tla2_vessel_005: - capacity: 1137 + capacity: 1067 parking: duration: 1 noise: 1 @@ -1609,7 +1609,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_000: - capacity: 6079 + capacity: 6332 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_001: - capacity: 6079 + capacity: 6965 parking: duration: 1 noise: 1 @@ -1628,10 +1628,10 @@ vessels: initial_port_name: manzanillo_mex route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 8 tlp1_vessel_002: - capacity: 6079 + capacity: 5699 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 6079 + capacity: 6332 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_004: - capacity: 6079 + capacity: 6965 parking: duration: 1 noise: 1 @@ -1661,10 +1661,10 @@ vessels: initial_port_name: sanAntonio_par route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 8 tlp1_vessel_005: - capacity: 6079 + capacity: 5699 parking: duration: 1 noise: 1 @@ -1672,5 +1672,5 @@ vessels: initial_port_name: yokohama_jpn route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 10 diff --git a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml index 524d0fc82..c38a34d1c 100644 --- a/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml +++ b/maro/simulator/scenarios/cim/topologies/global_trade.22p_l0.8/config.yml @@ -1,230 +1,234 @@ +seed: 4096 +transfer_cost_factors: + load: 0.05 + dsch: 0.05 container_usage_proportion: period: 112 sample_nodes: - - 0 - - 0.003 + - 0.015 - - 1 - - 0.0030120459811077806 + - 0.015012045981107782 - - 2 - - 0.0030444936159697397 + - 0.015044493615969741 - - 3 - - 0.003086758870970731 + - 0.015086758870970732 - - 4 - - 0.00312277494153067 + - 0.01512277494153067 - - 5 - - 0.003133182625055171 + - 0.01513318262505517 - - 6 - - 0.0030980737191358397 + - 0.01509807371913584 - - 7 - - 0.003 + - 0.015 - - 8 - - 0.003173074266317172 + - 0.015173074266317171 - - 9 - - 0.0034252030066171473 + - 0.015425203006617148 - - 10 - - 0.003750572812854111 + - 0.015750572812854108 - - 11 - - 0.004132546658976814 + - 0.016132546658976815 - - 12 - - 0.004543802523771078 + - 0.01654380252377108 - - 13 - - 0.0049476347099251024 + - 0.016947634709925108 - - 14 - - 0.005300377961276525 + - 0.017300377961276522 - - 15 - - 0.005554806245962416 + - 0.017554806245962416 - - 16 - - 0.00566425880641032 + - 0.01766425880641032 - - 17 - - 0.005587164736409392 + - 0.01758716473640939 - - 18 - - 0.0052915815731311225 + - 0.017291581573131123 - - 19 - - 0.004759338850452894 + - 0.016759338850452894 - - 20 - - 0.003989387422188653 + - 0.015989387422188653 - - 21 - - 0.003000000000000001 + - 0.015000000000000001 - - 22 - - 0.004170454760379227 + - 0.016170454760379226 - - 23 - - 0.005464338416109183 + - 0.017464338416109185 - - 24 - - 0.006807219708509132 + - 0.01880721970850913 - - 25 - - 0.008111919797577836 + - 0.020111919797577836 - - 26 - - 0.009283910705811102 + - 0.021283910705811104 - - 27 - - 0.010227730806249693 + - 0.02222773080624969 - - 28 - - 0.010853981633974483 + - 0.022853981633974483 - - 29 - - 0.011086401027200567 + - 0.023086401027200568 - - 30 - - 0.01086847517676566 + - 0.022868475176765664 - - 31 - - 0.010169060410756062 + - 0.022169060410756062 - - 32 - - 0.008986535197028633 + - 0.02098653519702863 - - 33 - - 0.007351091420509771 + - 0.01935109142050977 - - 34 - - 0.005324895896556256 + - 0.017324895896556256 - - 35 - - 0.003000000000000001 + - 0.015 - - 36 - - 0.005505963234746832 + - 0.017505963234746832 - - 37 - - 0.00805609098616606 + - 0.02005609098616606 - - 38 - - 0.01050217333240664 + - 0.022502173332406644 - - 39 - - 0.012693815471924507 + - 0.024693815471924507 - - 40 - - 0.014488127076166445 + - 0.02648812707616644 - - 41 - - 0.015759325587487844 + - 0.027759325587487844 - - 42 - - 0.01640758530667244 + - 0.028407585306672437 - - 43 - - 0.016366497123525156 + - 0.028366497123525156 - - 44 - - 0.015608583358805685 + - 0.027608583358805686 - - 45 - - 0.01414843354935709 + - 0.026148433549357086 - - 46 - - 0.012043182092683655 + - 0.024043182092683656 - - 47 - - 0.009390226830001812 + - 0.02139022683000181 - - 48 - - 0.006322276390618315 + - 0.018322276390618314 - - 49 - - 0.0030000000000000027 + - 0.015000000000000003 - - 50 - - 0.006397276937799643 + - 0.01839727693779964 - - 51 - - 0.009682247211563782 + - 0.021682247211563782 - - 52 - - 0.012670979964007095 + - 0.024670979964007092 - - 53 - - 0.015194221337363166 + - 0.027194221337363163 - - 54 - - 0.01710789226660702 + - 0.02910789226660702 - - 55 - - 0.018302085852342477 + - 0.030302085852342477 - - 56 - - 0.018707963267948966 + - 0.030707963267948966 - - 57 - - 0.01830208585234248 + - 0.03030208585234248 - - 58 - - 0.017107892266607024 + - 0.029107892266607024 - - 59 - - 0.015194221337363166 + - 0.027194221337363163 - - 60 - - 0.012670979964007099 + - 0.0246709799640071 - - 61 - - 0.009682247211563787 + - 0.021682247211563786 - - 62 - - 0.0063972769377996464 + - 0.018397276937799648 - - 63 - - 0.003000000000000001 + - 0.015000000000000001 - - 64 - - 0.006322276390618312 + - 0.01832227639061831 - - 65 - - 0.009390226830001807 + - 0.021390226830001805 - - 66 - - 0.012043182092683655 + - 0.024043182092683656 - - 67 - - 0.014148433549357083 + - 0.026148433549357086 - - 68 - - 0.015608583358805689 + - 0.02760858335880569 - - 69 - - 0.016366497123525156 + - 0.02836649712352516 - - 70 - - 0.016407585306672443 + - 0.028407585306672443 - - 71 - - 0.015759325587487844 + - 0.027759325587487844 - - 72 - - 0.014488127076166445 + - 0.026488127076166445 - - 73 - - 0.012693815471924514 + - 0.024693815471924514 - - 74 - - 0.010502173332406646 + - 0.022502173332406648 - - 75 - - 0.008056090986166064 + - 0.020056090986166064 - - 76 - - 0.005505963234746836 + - 0.017505963234746836 - - 77 - - 0.0030000000000000022 + - 0.015000000000000001 - - 78 - - 0.005324895896556256 + - 0.017324895896556256 - - 79 - - 0.007351091420509768 + - 0.019351091420509767 - - 80 - - 0.008986535197028633 + - 0.020986535197028634 - - 81 - - 0.010169060410756065 + - 0.022169060410756065 - - 82 - - 0.01086847517676566 + - 0.02286847517676566 - - 83 - - 0.011086401027200564 + - 0.02308640102720056 - - 84 - - 0.010853981633974486 + - 0.022853981633974483 - - 85 - - 0.0102277308062497 + - 0.022227730806249697 - - 86 - - 0.009283910705811103 + - 0.021283910705811104 - - 87 - - 0.008111919797577832 + - 0.020111919797577836 - - 88 - - 0.006807219708509134 + - 0.018807219708509137 - - 89 - - 0.005464338416109187 + - 0.017464338416109188 - - 90 - - 0.004170454760379229 + - 0.01617045476037923 - - 91 - - 0.0030000000000000005 + - 0.015 - - 92 - - 0.003989387422188652 + - 0.01598938742218865 - - 93 - - 0.004759338850452893 + - 0.01675933885045289 - - 94 - - 0.0052915815731311225 + - 0.017291581573131126 - - 95 - - 0.005587164736409394 + - 0.017587164736409394 - - 96 - - 0.005664258806410321 + - 0.01766425880641032 - - 97 - - 0.0055548062459624134 + - 0.017554806245962416 - - 98 - - 0.005300377961276526 + - 0.01730037796127653 - - 99 - - 0.004947634709925106 + - 0.016947634709925108 - - 100 - - 0.004543802523771078 + - 0.01654380252377108 - - 101 - - 0.004132546658976813 + - 0.01613254665897681 - - 102 - - 0.003750572812854112 + - 0.01575057281285411 - - 103 - - 0.0034252030066171486 + - 0.015425203006617148 - - 104 - - 0.0031730742663171724 + - 0.015173074266317171 - - 105 - - 0.003 + - 0.015 - - 106 - - 0.0030980737191358397 + - 0.01509807371913584 - - 107 - - 0.003133182625055171 + - 0.01513318262505517 - - 108 - - 0.00312277494153067 + - 0.01512277494153067 - - 109 - - 0.003086758870970731 + - 0.015086758870970732 - - 110 - - 0.0030444936159697397 + - 0.015044493615969741 - - 111 - - 0.0030120459811077806 + - 0.015012045981107782 sample_noise: 0.002 container_volumes: - 1 @@ -241,32 +245,32 @@ ports: initial_container_proportion: 0.16 order_distribution: source: - noise: 0.029541906819651888 + noise: 0.025134751494652507 proportion: 0.16 targets: leHavre_fra: - noise: 0.027174439537617754 + noise: 0.025432733187591285 proportion: 0.18755329471737509 montreal_can: - noise: 0.00980727387825093 + noise: 0.014981815264884504 proportion: 0.0756906048807678 newYork_usa: - noise: 0.0027637832634372895 + noise: 0.07860790872534353 proportion: 0.47933778254893905 pusan_kor: - noise: 0.014430384061284766 + noise: 0.002902145091237068 proportion: 0.07667664751459422 qingdao_chn: - noise: 0.006930094460708154 + noise: 0.0016703057083900894 proportion: 0.0512157380304634 shanghai_chn: - noise: 0.008742270235780183 + noise: 0.004329384963154748 proportion: 0.04763588234031061 singapore_sgp: - noise: 0.0011347602771777819 + noise: 0.00014700838968303593 proportion: 0.005882857005910926 yantian_chn: - noise: 0.006193414953469088 + noise: 0.014277274600949947 proportion: 0.07600719296163895 durban_sau: capacity: 10000 @@ -279,20 +283,20 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012369701713498126 + noise: 0.0003905851406890507 proportion: 0.01 targets: qingdao_chn: - noise: 0.012364772365962309 + noise: 0.03386602700899302 proportion: 0.2502879616953551 shanghai_chn: - noise: 0.00352215419270645 + noise: 0.04099351916502508 proportion: 0.2501170152675811 singapore_sgp: - noise: 0.028599483759999704 + noise: 0.02983331512414685 proportion: 0.24812321657873454 yantian_chn: - noise: 0.04900330203859365 + noise: 0.0398838857119423 proportion: 0.25147180645832923 itagual_bra: capacity: 10000 @@ -305,23 +309,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0009621506996928753 + noise: 0.0017049012580563228 proportion: 0.01 targets: qingdao_chn: - noise: 0.026090492586688295 + noise: 0.006704071585248814 proportion: 0.19992517767067194 santos_bra: - noise: 0.012641742172183024 + noise: 0.01065215665926791 proportion: 0.20145578663243896 shanghai_chn: - noise: 0.03176028945781009 + noise: 0.01889939427623029 proportion: 0.19975353803822685 singapore_sgp: - noise: 0.009817528692331708 + noise: 0.030425501405892584 proportion: 0.19775168293424744 yantian_chn: - noise: 0.009621093160930289 + noise: 0.0038049637706619867 proportion: 0.20111381472441478 leHavre_fra: capacity: 10000 @@ -334,32 +338,32 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.0018886517487191057 + noise: 0.010023093144315015 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.004315181577345305 + noise: 0.046713884416130814 proportion: 0.2613085269688243 montreal_can: - noise: 0.016843903962712903 + noise: 0.007011738109808054 proportion: 0.09474419644790176 newYork_usa: - noise: 0.009488796573182388 + noise: 0.0075575968616494 proportion: 0.20255309034522379 pusan_kor: - noise: 0.016473206464419552 + noise: 0.0022204132834372364 proportion: 0.09500755942526971 qingdao_chn: - noise: 0.016694752769885985 + noise: 0.0025163323117031356 proportion: 0.08820727646821312 shanghai_chn: - noise: 0.01034247956021821 + noise: 0.012253843912920523 proportion: 0.08725114792024982 singapore_sgp: - noise: 0.0017025555020105283 + noise: 0.014556815408633276 proportion: 0.07609945087001035 yantian_chn: - noise: 0.012420348270095348 + noise: 0.007509358525794673 proportion: 0.09482875155430699 losAngeles_usa: capacity: 10000 @@ -372,23 +376,23 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0010398317467610486 + noise: 0.007441531984981497 proportion: 0.05 targets: oakland_usa: - noise: 0.046610961242872055 + noise: 0.04265188459544233 proportion: 0.27616189497862537 princeRupert_can: - noise: 0.0034681253869941176 + noise: 0.00273897680516611 proportion: 0.15754923155692402 qingdao_chn: - noise: 0.021860225648515103 + noise: 0.01517255937598155 proportion: 0.1623492157793647 seattle_usa: - noise: 0.04086143525071624 + noise: 0.014299850500812094 proportion: 0.2423747616801366 shanghai_chn: - noise: 0.003862724565463262 + noise: 0.0051011672478115 proportion: 0.16156489600494922 manzanillo_mex: capacity: 10000 @@ -401,29 +405,29 @@ ports: initial_container_proportion: 0.05 order_distribution: source: - noise: 0.0076983570213705055 + noise: 0.005425915310841583 proportion: 0.05 targets: manzanillo_mex: - noise: 0.0046065639504877355 + noise: 0.0073296927183103605 proportion: 0.1642819028757581 pusan_kor: - noise: 0.0025188189984588993 + noise: 0.018169915140256784 proportion: 0.1269237319062987 qingdao_chn: - noise: 0.007167172404922409 + noise: 0.02383787277319661 proportion: 0.12072756120502863 sanAntonio_par: - noise: 0.004215477057755458 + noise: 0.0025563544317216205 proportion: 0.10518021746764428 shanghai_chn: - noise: 0.0015807008466467236 + noise: 0.02058384394808081 proportion: 0.11985637174894495 yantian_chn: - noise: 0.004717980724301031 + noise: 0.00989286132515691 proportion: 0.12676080545008 yokohama_jpn: - noise: 0.027332270387564594 + noise: 0.0007488162438248653 proportion: 0.23626940934624543 melbourne_aus: capacity: 10000 @@ -436,17 +440,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.00041927575320429856 + noise: 0.0029979553756433923 proportion: 0.015 targets: singapore_sgp: - noise: 0.01720316773737656 + noise: 0.0566906410775888 proportion: 0.3293364398135728 sydney_aus: - noise: 0.0317483357682384 + noise: 0.01865388192132147 proportion: 0.3364188275147848 yantian_chn: - noise: 6.275255136458467e-05 + noise: 0.014238633997660635 proportion: 0.33424473267164256 montreal_can: capacity: 10000 @@ -459,14 +463,14 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0001058824653549524 + noise: 0.0005621554647653919 proportion: 0.015 targets: bremerhaven_ger: - noise: 0.08372460982561138 + noise: 0.08779643369212999 proportion: 0.5172441914124826 leHavre_fra: - noise: 0.005206377376346192 + noise: 0.07842477295179612 proportion: 0.4827558085875176 newYork_usa: capacity: 10000 @@ -479,14 +483,14 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.0023971524264589056 + noise: 0.00016057717079772171 proportion: 0.03 targets: bremerhaven_ger: - noise: 0.10416372800484693 + noise: 0.05981761122488196 proportion: 0.5332513888590196 leHavre_fra: - noise: 0.05774414602239579 + noise: 0.03990533991720246 proportion: 0.46674861114098054 oakland_usa: capacity: 10000 @@ -499,20 +503,20 @@ ports: initial_container_proportion: 0.03 order_distribution: source: - noise: 0.005226544429947875 + noise: 0.004910915544061917 proportion: 0.03 targets: losAngeles_usa: - noise: 0.054178562561998066 + noise: 0.048963812038470556 proportion: 0.30175478642890274 princeRupert_can: - noise: 0.044477996162498444 + noise: 0.0254961817963097 proportion: 0.23086917432389525 qingdao_chn: - noise: 0.03359401622082758 + noise: 0.03349874892050399 proportion: 0.23393880851694335 shanghai_chn: - noise: 0.04268416733729023 + noise: 0.012993114869682515 proportion: 0.23343723073025868 princeRupert_can: capacity: 10000 @@ -525,20 +529,20 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.0029718257861642474 + noise: 0.0027667472862969076 proportion: 0.015 targets: losAngeles_usa: - noise: 0.008826102450863998 + noise: 0.05091486367601389 proportion: 0.2657898185062753 oakland_usa: - noise: 0.0011354503888720232 + noise: 0.028397329439457514 proportion: 0.26818216862044597 qingdao_chn: - noise: 0.014679852245526353 + noise: 0.0016646658939369785 proportion: 0.23313476502804797 shanghai_chn: - noise: 0.044867678747918735 + noise: 0.013742472852754001 proportion: 0.23289324784523086 pusan_kor: capacity: 10000 @@ -551,41 +555,41 @@ ports: initial_container_proportion: 0.06 order_distribution: source: - noise: 0.002973353584364918 + noise: 0.009320427377742116 proportion: 0.06 targets: bremerhaven_ger: - noise: 0.015482405581896957 + noise: 0.031991420231325084 proportion: 0.21204226502906795 leHavre_fra: - noise: 0.0001302647468009758 + noise: 0.005105457599858164 proportion: 0.08535909653471886 manzanillo_mex: - noise: 0.010572876890368834 + noise: 0.005809147275802185 proportion: 0.0959125358074426 qingdao_chn: - noise: 0.0025256790825975454 + noise: 0.0033945457967072133 proportion: 0.051610240792657115 sanAntonio_par: - noise: 0.0010682303655455128 + noise: 0.001854192137165468 proportion: 0.035795894860646466 seattle_usa: - noise: 0.009613260507944536 + noise: 0.018330317944630015 proportion: 0.14202580193983683 shanghai_chn: - noise: 0.0078571916664256 + noise: 0.009459052846765289 proportion: 0.05072408949335503 singapore_sgp: - noise: 0.0034843695558064575 + noise: 0.0016197423680226325 proportion: 0.04038858042581788 vancouver_can: - noise: 0.00964564143149089 + noise: 0.00469787131269142 proportion: 0.059258114284493034 yantian_chn: - noise: 0.006902002888592339 + noise: 0.003856257701007031 proportion: 0.05774708854229363 yokohama_jpn: - noise: 0.011337884438636026 + noise: 0.014803870326138143 proportion: 0.1691362922896707 qingdao_chn: capacity: 10000 @@ -598,53 +602,53 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.010033077426210528 + noise: 0.007181454765417904 proportion: 0.08 targets: bremerhaven_ger: - noise: 0.02614017182248326 + noise: 0.02952708760272511 proportion: 0.19166868266386958 durban_sau: - noise: 0.0017387242678691362 + noise: 0.0026860007722877676 proportion: 0.025475188174797537 itagual_bra: - noise: 0.0003486452742150132 + noise: 0.0023058721270403397 proportion: 0.020374390901285715 leHavre_fra: - noise: 0.009182092408099281 + noise: 0.008262798336030506 proportion: 0.04940051725539669 losAngeles_usa: - noise: 0.022644078007304263 + noise: 0.014599621251693524 proportion: 0.14605127409748705 manzanillo_mex: - noise: 0.0076428490407138075 + noise: 0.004578888771735588 proportion: 0.061252276599797005 oakland_usa: - noise: 0.00338044200189517 + noise: 0.0018968128853613635 proportion: 0.15590868899027802 princeRupert_can: - noise: 0.0005795702643972235 + noise: 7.825075850514062e-05 proportion: 0.005409393840032325 pusan_kor: - noise: 0.0034591090510660938 + noise: 0.0007151691535729856 proportion: 0.018577689927305203 santos_bra: - noise: 0.0019028622663675436 + noise: 0.0036806154087330586 proportion: 0.02037439104592543 seattle_usa: - noise: 0.0022840751022966794 + noise: 0.0016116464454415448 proportion: 0.113038562331156 shanghai_chn: - noise: 0.0013813896490110294 + noise: 0.0011503058311188963 proportion: 0.010504586083902057 vancouver_can: - noise: 0.0014244818796804444 + noise: 0.0031091344585237185 proportion: 0.02008850220677704 yantian_chn: - noise: 0.0026191834198310256 + noise: 0.0017512950798533396 proportion: 0.018391591436727996 yokohama_jpn: - noise: 0.003894234191508894 + noise: 0.023837737047619264 proportion: 0.14348426444526224 sanAntonio_par: capacity: 10000 @@ -657,26 +661,26 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.0012134052104793088 + noise: 0.0015229565945744795 proportion: 0.01 targets: manzanillo_mex: - noise: 0.012532297887460412 + noise: 0.029864110340333205 proportion: 0.1695702560614863 pusan_kor: - noise: 0.01302248526372375 + noise: 0.030434021872288986 proportion: 0.16240810942168046 qingdao_chn: - noise: 0.005397619577307389 + noise: 0.031654173870326326 proportion: 0.1612201993861513 shanghai_chn: - noise: 0.01679312314459858 + noise: 0.022840905205567065 proportion: 0.16105317774270345 yantian_chn: - noise: 0.019729642431771596 + noise: 0.022058626605590343 proportion: 0.16237686231768783 yokohama_jpn: - noise: 0.0055375795509528414 + noise: 0.020882193597463152 proportion: 0.18337139507029068 santos_bra: capacity: 10000 @@ -689,23 +693,23 @@ ports: initial_container_proportion: 0.01 order_distribution: source: - noise: 0.001877414087116521 + noise: 0.0017591918390130468 proportion: 0.01 targets: itagual_bra: - noise: 0.032004242821693965 + noise: 0.00015677478442405662 proportion: 0.20145578737905992 qingdao_chn: - noise: 0.02033932536567358 + noise: 0.007951708444894913 proportion: 0.19992517738434895 shanghai_chn: - noise: 0.03140598123730028 + noise: 0.008394529742993468 proportion: 0.19975353831991421 singapore_sgp: - noise: 0.01821241418824103 + noise: 0.01406059678653582 proportion: 0.19775168256638195 yantian_chn: - noise: 0.0026235148173812395 + noise: 0.011310434190498734 proportion: 0.20111381435029493 seattle_usa: capacity: 10000 @@ -718,29 +722,29 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.003107859253019168 + noise: 0.009178972285261822 proportion: 0.07 targets: losAngeles_usa: - noise: 0.05753073850487432 + noise: 0.023523817623575388 proportion: 0.2912736754142012 pusan_kor: - noise: 0.0016502073135337876 + noise: 0.01876947062956955 proportion: 0.12538821688519616 qingdao_chn: - noise: 0.011314497001275887 + noise: 0.02029673306956859 proportion: 0.11617748395503369 shanghai_chn: - noise: 0.005508132238408478 + noise: 0.011329185762784782 proportion: 0.11488243812354347 singapore_sgp: - noise: 0.019332283176789165 + noise: 0.00024014816912197655 proportion: 0.09977785851511455 vancouver_can: - noise: 0.006127488353504421 + noise: 0.02057342705041732 proportion: 0.1273542861551621 yantian_chn: - noise: 0.01754766809268637 + noise: 0.020083358186626803 proportion: 0.12514604095174878 shanghai_chn: capacity: 10000 @@ -753,50 +757,50 @@ ports: initial_container_proportion: 0.1 order_distribution: source: - noise: 0.017095220699748878 + noise: 0.017109626305467616 proportion: 0.1 targets: bremerhaven_ger: - noise: 0.041084325927985985 + noise: 0.021959106592952006 proportion: 0.21398371679064213 durban_sau: - noise: 0.0021696529552618954 + noise: 0.00010435314516980227 proportion: 0.017462167174606275 itagual_bra: - noise: 0.0008030025073271739 + noise: 0.0020594969751376174 proportion: 0.011430536063236027 leHavre_fra: - noise: 0.0015848506299856926 + noise: 0.0009873199353313093 proportion: 0.04575353580273499 losAngeles_usa: - noise: 0.00755174044562672 + noise: 0.014743978442771179 proportion: 0.16004173887997492 manzanillo_mex: - noise: 0.011854629177267675 + noise: 0.0012374290703743276 proportion: 0.05976808154382374 oakland_usa: - noise: 0.028784906675318727 + noise: 0.022426459611386496 proportion: 0.1716979971992254 pusan_kor: - noise: 0.0017948328245855443 + noise: 0.0005070099495173756 proportion: 0.00930596400725694 qingdao_chn: - noise: 0.000182985585552497 + noise: 1.8783239577936313e-05 proportion: 0.0009364036349727401 santos_bra: - noise: 0.0007693144229259965 + noise: 0.0012407696401487867 proportion: 0.011430536346128936 seattle_usa: - noise: 0.015979262018439678 + noise: 0.011299147787220907 proportion: 0.12100465463531186 vancouver_can: - noise: 0.0006937704178989623 + noise: 0.002147321460772641 proportion: 0.011092475826618629 yantian_chn: - noise: 0.0012210056169907513 + noise: 0.000883163479902347 proportion: 0.009085896257062817 yokohama_jpn: - noise: 0.010669005317136996 + noise: 0.012495339718107597 proportion: 0.1570062958384047 singapore_sgp: capacity: 10000 @@ -809,53 +813,53 @@ ports: initial_container_proportion: 0.04 order_distribution: source: - noise: 0.0012836259212510967 + noise: 0.0014198451145378962 proportion: 0.04 targets: bremerhaven_ger: - noise: 0.02731130789420123 + noise: 0.02403294164090424 proportion: 0.16163465526933787 durban_sau: - noise: 0.0079917530205346 + noise: 0.007339857249890276 proportion: 0.052947229587582224 itagual_bra: - noise: 0.007301258651251609 + noise: 0.004826948332878951 proportion: 0.049611409618781833 leHavre_fra: - noise: 0.0022920930271172033 + noise: 0.000697323478201817 proportion: 0.06859394881607536 melbourne_aus: - noise: 0.000927122980718493 + noise: 0.009748446374379698 proportion: 0.054598902525719965 pusan_kor: - noise: 0.001481325232631238 + noise: 0.0052864459821632135 proportion: 0.04843640111672956 qingdao_chn: - noise: 0.0035672054884738702 + noise: 0.00020264478777542088 proportion: 0.04380756610509279 santos_bra: - noise: 0.0072911626019552455 + noise: 0.0060662606703405855 proportion: 0.0496114180206766 seattle_usa: - noise: 0.021977682321328896 + noise: 0.002184489196293904 proportion: 0.11021203091597927 shanghai_chn: - noise: 0.006000301686369274 + noise: 0.00446890645579302 proportion: 0.043156750350596414 singapore_sgp: - noise: 0.005118668874191572 + noise: 0.0005079804300151535 proportion: 0.03556597867096123 sydney_aus: - noise: 0.0014991769548569809 + noise: 0.0032814259751614335 proportion: 0.053961624659387086 vancouver_can: - noise: 0.008355987327740363 + noise: 0.0013725415556900408 proportion: 0.04942443509903704 yantian_chn: - noise: 0.00424493151411591 + noise: 0.007866049277209214 proportion: 0.04831469461601993 yokohama_jpn: - noise: 0.023481573062834743 + noise: 0.013995694253814077 proportion: 0.13012295462802295 sydney_aus: capacity: 10000 @@ -868,17 +872,17 @@ ports: initial_container_proportion: 0.015 order_distribution: source: - noise: 0.002155120895930923 + noise: 5.318259543305715e-05 proportion: 0.015 targets: melbourne_aus: - noise: 0.043272556095345846 + noise: 0.010959524006592607 proportion: 0.33665441119009204 singapore_sgp: - noise: 0.021150293369866142 + noise: 0.013378806626384264 proportion: 0.3291642505650358 yantian_chn: - noise: 0.032126637177988214 + noise: 0.043398566324619615 proportion: 0.3341813382448723 vancouver_can: capacity: 10000 @@ -891,26 +895,26 @@ ports: initial_container_proportion: 0.02 order_distribution: source: - noise: 0.0017361691924081258 + noise: 0.002260078974868654 proportion: 0.02 targets: pusan_kor: - noise: 0.030070192002213465 + noise: 0.01022517907397126 proportion: 0.16323476832180567 qingdao_chn: - noise: 0.0007756258463724296 + noise: 0.025111111836521687 proportion: 0.16078294599848347 seattle_usa: - noise: 0.034787830472740866 + noise: 0.025666860266381805 proportion: 0.19595625809774195 shanghai_chn: - noise: 0.028936107345725295 + noise: 0.00391575019491024 proportion: 0.1604382196746799 singapore_sgp: - noise: 0.009484290050201566 + noise: 0.009869415376296499 proportion: 0.15641751563334233 yantian_chn: - noise: 0.0057514035358065966 + noise: 0.01646828787230074 proportion: 0.1631702922739467 yantian_chn: capacity: 10000 @@ -923,56 +927,56 @@ ports: initial_container_proportion: 0.07 order_distribution: source: - noise: 0.008422256646885302 + noise: 0.005460106707641842 proportion: 0.07 targets: bremerhaven_ger: - noise: 0.011723548393014914 + noise: 0.03183934815230198 proportion: 0.23063506921338092 durban_sau: - noise: 0.007028309982650573 + noise: 0.006955761417407662 proportion: 0.036977112629701755 itagual_bra: - noise: 0.0021232511744929236 + noise: 0.003879986047538319 proportion: 0.03103337062146673 leHavre_fra: - noise: 0.01244233221440464 + noise: 0.0033746270986396783 proportion: 0.06485623632186012 manzanillo_mex: - noise: 0.005219875180760516 + noise: 0.014297914647911386 proportion: 0.07866656356344162 melbourne_aus: - noise: 0.00325693140987167 + noise: 0.0055998037357593185 proportion: 0.03992004007199072 pusan_kor: - noise: 0.0020033324939384353 + noise: 0.004337884540903886 proportion: 0.028939753926030695 qingdao_chn: - noise: 0.0024288519568081467 + noise: 0.0034845335834618927 proportion: 0.020692152164438926 santos_bra: - noise: 0.005917956078164042 + noise: 0.0023084677027446535 proportion: 0.03103337095193521 seattle_usa: - noise: 0.008224490506305046 + noise: 0.0043141199296154705 proportion: 0.13901084519757625 shanghai_chn: - noise: 0.0012713160693603898 + noise: 0.0001996474876791818 proportion: 0.01953252624072474 singapore_sgp: - noise: 0.0005993163297166358 + noise: 0.0011502086812016938 proportion: 0.006007386215135132 sydney_aus: - noise: 0.003553789802863408 + noise: 0.0019319056238978993 proportion: 0.03878455068512264 vancouver_can: - noise: 0.005818365387463014 + noise: 0.0007858696914021227 proportion: 0.03070023678474206 yantian_chn: - noise: 0.000937390505729158 + noise: 0.0016168667042640794 proportion: 0.02872289950079146 yokohama_jpn: - noise: 0.0075575175422493215 + noise: 0.023246811699828965 proportion: 0.17448788591166092 yokohama_jpn: capacity: 10000 @@ -985,29 +989,29 @@ ports: initial_container_proportion: 0.08 order_distribution: source: - noise: 0.0008778537933683098 + noise: 0.014254332625813097 proportion: 0.08 targets: manzanillo_mex: - noise: 0.011810938798409994 + noise: 0.03244047063421112 proportion: 0.224773870587767 pusan_kor: - noise: 0.022595884352223653 + noise: 0.018126081484701975 proportion: 0.1473122137604972 qingdao_chn: - noise: 0.024907581311612293 + noise: 0.017152304680050526 proportion: 0.1344645529933837 sanAntonio_par: - noise: 0.008287924815679014 + noise: 0.0003086488347039955 proportion: 0.10222734144856105 shanghai_chn: - noise: 0.0066037712087852 + noise: 0.0056287128415065625 proportion: 0.13265815413379464 singapore_sgp: - noise: 0.016272909688446892 + noise: 0.019438990767313084 proportion: 0.1115894561579222 yantian_chn: - noise: 0.020166976986305943 + noise: 0.014838419143613479 proportion: 0.14697441091807414 routes: a3s: @@ -1159,17 +1163,13 @@ routes: port_name: yokohama_jpn - distance: 60 port_name: shanghai_chn -seed: 4096 stop_number: - 4 - 3 total_containers: 100000 -transfer_cost_factors: - dsch: 0.05 - load: 0.05 vessels: a3s_vessel_000: - capacity: 928 + capacity: 871 parking: duration: 1 noise: 1 @@ -1177,10 +1177,10 @@ vessels: initial_port_name: yantian_chn route_name: a3s sailing: - noise: 1 + noise: 2 speed: 10 a3s_vessel_001: - capacity: 928 + capacity: 967 parking: duration: 1 noise: 1 @@ -1191,7 +1191,7 @@ vessels: noise: 2 speed: 9 asa_vessel_000: - capacity: 525 + capacity: 601 parking: duration: 1 noise: 1 @@ -1202,7 +1202,7 @@ vessels: noise: 1 speed: 8 asa_vessel_001: - capacity: 525 + capacity: 493 parking: duration: 1 noise: 1 @@ -1210,10 +1210,10 @@ vessels: initial_port_name: melbourne_aus route_name: asa sailing: - noise: 1 + noise: 2 speed: 10 ate1_vessel_000: - capacity: 5528 + capacity: 5758 parking: duration: 1 noise: 1 @@ -1221,10 +1221,10 @@ vessels: initial_port_name: newYork_usa route_name: ate1 sailing: - noise: 2 + noise: 1 speed: 9 ate1_vessel_001: - capacity: 5528 + capacity: 6333 parking: duration: 1 noise: 1 @@ -1235,7 +1235,7 @@ vessels: noise: 1 speed: 8 gex1_vessel_000: - capacity: 1101 + capacity: 1033 parking: duration: 1 noise: 1 @@ -1246,7 +1246,7 @@ vessels: noise: 2 speed: 10 gex1_vessel_001: - capacity: 1101 + capacity: 1147 parking: duration: 1 noise: 1 @@ -1254,10 +1254,10 @@ vessels: initial_port_name: montreal_can route_name: gex1 sailing: - noise: 2 + noise: 1 speed: 9 ktx5_vessel_000: - capacity: 1359 + capacity: 1557 parking: duration: 1 noise: 1 @@ -1265,10 +1265,10 @@ vessels: initial_port_name: singapore_sgp route_name: ktx5 sailing: - noise: 2 + noise: 1 speed: 8 ktx5_vessel_001: - capacity: 1359 + capacity: 1275 parking: duration: 1 noise: 1 @@ -1276,10 +1276,10 @@ vessels: initial_port_name: yokohama_jpn route_name: ktx5 sailing: - noise: 2 + noise: 1 speed: 10 ll4_vessel_000: - capacity: 6339 + capacity: 6603 parking: duration: 1 noise: 1 @@ -1287,10 +1287,10 @@ vessels: initial_port_name: bremerhaven_ger route_name: ll4 sailing: - noise: 1 + noise: 2 speed: 9 ll4_vessel_001: - capacity: 6339 + capacity: 7263 parking: duration: 1 noise: 1 @@ -1301,7 +1301,7 @@ vessels: noise: 2 speed: 8 ll4_vessel_002: - capacity: 6339 + capacity: 5943 parking: duration: 1 noise: 1 @@ -1312,7 +1312,7 @@ vessels: noise: 1 speed: 10 ll4_vessel_003: - capacity: 6339 + capacity: 6603 parking: duration: 1 noise: 1 @@ -1323,7 +1323,7 @@ vessels: noise: 1 speed: 9 ll4_vessel_004: - capacity: 6339 + capacity: 7263 parking: duration: 1 noise: 1 @@ -1331,10 +1331,10 @@ vessels: initial_port_name: pusan_kor route_name: ll4 sailing: - noise: 2 + noise: 1 speed: 8 ll4_vessel_005: - capacity: 6339 + capacity: 5943 parking: duration: 1 noise: 1 @@ -1345,7 +1345,7 @@ vessels: noise: 1 speed: 10 pcc1_vessel_000: - capacity: 4725 + capacity: 4922 parking: duration: 1 noise: 1 @@ -1356,7 +1356,7 @@ vessels: noise: 1 speed: 9 pcc1_vessel_001: - capacity: 4725 + capacity: 5414 parking: duration: 1 noise: 1 @@ -1364,10 +1364,10 @@ vessels: initial_port_name: qingdao_chn route_name: pcc1 sailing: - noise: 1 + noise: 2 speed: 8 pcc1_vessel_002: - capacity: 4725 + capacity: 4430 parking: duration: 1 noise: 1 @@ -1378,7 +1378,7 @@ vessels: noise: 1 speed: 10 pcc2_vessel_000: - capacity: 2346 + capacity: 2443 parking: duration: 1 noise: 1 @@ -1386,10 +1386,10 @@ vessels: initial_port_name: seattle_usa route_name: pcc2 sailing: - noise: 1 + noise: 2 speed: 9 pcc2_vessel_001: - capacity: 2346 + capacity: 2687 parking: duration: 1 noise: 1 @@ -1400,7 +1400,7 @@ vessels: noise: 2 speed: 8 pcc2_vessel_002: - capacity: 2346 + capacity: 2199 parking: duration: 1 noise: 1 @@ -1411,7 +1411,7 @@ vessels: noise: 2 speed: 10 pnw1_vessel_000: - capacity: 2044 + capacity: 2129 parking: duration: 1 noise: 1 @@ -1419,10 +1419,10 @@ vessels: initial_port_name: seattle_usa route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 9 pnw1_vessel_001: - capacity: 2044 + capacity: 2341 parking: duration: 1 noise: 1 @@ -1433,7 +1433,7 @@ vessels: noise: 1 speed: 8 pnw1_vessel_002: - capacity: 2044 + capacity: 1917 parking: duration: 1 noise: 1 @@ -1441,10 +1441,10 @@ vessels: initial_port_name: yantian_chn route_name: pnw1 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_000: - capacity: 861 + capacity: 897 parking: duration: 1 noise: 1 @@ -1452,10 +1452,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 1 + noise: 2 speed: 9 pnw2_vessel_001: - capacity: 861 + capacity: 986 parking: duration: 1 noise: 1 @@ -1466,7 +1466,7 @@ vessels: noise: 2 speed: 8 pnw2_vessel_002: - capacity: 861 + capacity: 808 parking: duration: 1 noise: 1 @@ -1474,10 +1474,10 @@ vessels: initial_port_name: vancouver_can route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 10 pnw2_vessel_003: - capacity: 861 + capacity: 897 parking: duration: 1 noise: 1 @@ -1485,10 +1485,10 @@ vessels: initial_port_name: pusan_kor route_name: pnw2 sailing: - noise: 2 + noise: 1 speed: 9 pnw2_vessel_004: - capacity: 861 + capacity: 986 parking: duration: 1 noise: 1 @@ -1499,7 +1499,7 @@ vessels: noise: 1 speed: 8 saf3_vessel_000: - capacity: 621 + capacity: 583 parking: duration: 1 noise: 1 @@ -1507,10 +1507,10 @@ vessels: initial_port_name: yantian_chn route_name: saf3 sailing: - noise: 2 + noise: 1 speed: 10 saf3_vessel_001: - capacity: 621 + capacity: 647 parking: duration: 1 noise: 1 @@ -1521,7 +1521,7 @@ vessels: noise: 1 speed: 9 saf3_vessel_002: - capacity: 621 + capacity: 711 parking: duration: 1 noise: 1 @@ -1532,7 +1532,7 @@ vessels: noise: 2 speed: 8 saf3_vessel_003: - capacity: 621 + capacity: 583 parking: duration: 1 noise: 1 @@ -1543,7 +1543,7 @@ vessels: noise: 2 speed: 10 tla2_vessel_000: - capacity: 1137 + capacity: 1185 parking: duration: 1 noise: 1 @@ -1551,10 +1551,10 @@ vessels: initial_port_name: itagual_bra route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 9 tla2_vessel_001: - capacity: 1137 + capacity: 1303 parking: duration: 1 noise: 1 @@ -1562,10 +1562,10 @@ vessels: initial_port_name: santos_bra route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 8 tla2_vessel_002: - capacity: 1137 + capacity: 1067 parking: duration: 1 noise: 1 @@ -1573,10 +1573,10 @@ vessels: initial_port_name: singapore_sgp route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 10 tla2_vessel_003: - capacity: 1137 + capacity: 1185 parking: duration: 1 noise: 1 @@ -1584,10 +1584,10 @@ vessels: initial_port_name: shanghai_chn route_name: tla2 sailing: - noise: 2 + noise: 1 speed: 9 tla2_vessel_004: - capacity: 1137 + capacity: 1303 parking: duration: 1 noise: 1 @@ -1595,10 +1595,10 @@ vessels: initial_port_name: qingdao_chn route_name: tla2 sailing: - noise: 1 + noise: 2 speed: 8 tla2_vessel_005: - capacity: 1137 + capacity: 1067 parking: duration: 1 noise: 1 @@ -1609,7 +1609,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_000: - capacity: 6079 + capacity: 6332 parking: duration: 1 noise: 1 @@ -1620,7 +1620,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_001: - capacity: 6079 + capacity: 6965 parking: duration: 1 noise: 1 @@ -1628,10 +1628,10 @@ vessels: initial_port_name: manzanillo_mex route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 8 tlp1_vessel_002: - capacity: 6079 + capacity: 5699 parking: duration: 1 noise: 1 @@ -1642,7 +1642,7 @@ vessels: noise: 1 speed: 10 tlp1_vessel_003: - capacity: 6079 + capacity: 6332 parking: duration: 1 noise: 1 @@ -1653,7 +1653,7 @@ vessels: noise: 2 speed: 9 tlp1_vessel_004: - capacity: 6079 + capacity: 6965 parking: duration: 1 noise: 1 @@ -1661,10 +1661,10 @@ vessels: initial_port_name: sanAntonio_par route_name: tlp1 sailing: - noise: 2 + noise: 1 speed: 8 tlp1_vessel_005: - capacity: 6079 + capacity: 5699 parking: duration: 1 noise: 1 @@ -1672,5 +1672,5 @@ vessels: initial_port_name: yokohama_jpn route_name: tlp1 sailing: - noise: 1 + noise: 2 speed: 10