SCML2021World

class scml.scml2020.SCML2021World(*args, **kwargs)

Bases: scml.SCML2020World

Methods Summary

generate(*args[, …])

Generates the configuration for a world

Methods Documentation

classmethod generate(*args, inventory_valuation_trading=(0.0, 0.5), horizon=(0.2, 0.5), **kwargs)

Generates the configuration for a world

Parameters
  • agent_types – All agent types

  • agent_params – Agent parameters used to initialize them

  • n_steps – Number of simulation steps

  • n_processes – Number of processes in the production chain

  • n_lines – Number of lines per factory

  • process_inputs – Number of input units per process

  • process_outputs – Number of output units per process

  • production_costs – Production cost per factory

  • profit_means – Mean profitability per production level (i.e. process).

  • profit_stddevs – Std. Dev. of the profitability of every level (i.e. process).

  • inventory_valuation_catalog – The fraction of catalog price to value items at the end.

  • inventory_valuation_trading (Union[ndarray, Tuple[float, float], float]) – The fraction of trading price to value items at the end.

  • max_productivity – Maximum possible productivity per level (i.e. process).

  • initial_balance – The initial balance of all agents

  • n_agents_per_process – Number of agents per process

  • cost_increases_with_level – If true, production cost will be higher for processes nearer to the final product.

  • profit_basis – The statistic used when controlling catalog prices by profit arguments. It can be np.mean, np.median, np.min, np.max or any Callable[[list[float]], float] and is used to summarize production costs at every level.

  • horizon (Union[Tuple[float, float], float]) – The horizon used for revealing external supply/sales as a fraction of n_steps

  • equal_exogenous_supply – If true, external supply will be distributed equally among all agents in the first layer

  • equal_exogenous_sales – If true, external sales will be distributed equally among all agents in the last layer

  • exogenous_supply_predictability – How predictable are exogenous supplies of each agent over time. 1.0 means that every agent will have the same quantity for all of its contracts over time. 0.0 means quantities per agent are completely random

  • exogenous_sales_predictability – How predictable are exogenous supplies of each agent over time. 1.0 means that every agent will have the same quantity for all of its contracts over time. 0.0 means quantities per agent are completely random

  • cash_availability – The fraction of the total money needs of the agent to work at maximum capacity that is available as initial_balance . This is only effective if initial_balance is set to None .

  • force_signing – Whether to force contract signatures (exogenous contracts are treated in the same way).

  • exogenous_control – How much control does the agent have over exogenous contract signing. Only effective if force_signing is False and use_exogenous_contracts is True

  • random_agent_types – If True, the final agent types used by the generato wil always be sampled from the given types. If False, this random sampling will only happin if len(agent_types) != n_agents.

  • cost_relativity – The exponent of production cost used to distribute contracts during generation

  • method – The method used for world generation. Available methods are “profitable” and “guaranteed_profit”

  • exogenous_supply_surplus – The surpolus exogenous supply contract quantity to add to the system as a fraction of the a fraction of the contracts generated by the given method.

  • exogenous_sales_surplus – The surpolus exogenous sales contract quantity to add to the system as a fraction of the a fraction of the contracts generated by the given method.

  • run_extra_checks – If given, the world generation method will check whether the genrated world “makes sense” given its internal criteria. May slow down world generation

  • **kwargs

Return type

Dict[str, Any]

Returns

world configuration as a Dict[str, Any]. A world can be generated from this dict by calling SCML2020World(**d)

Remarks:

  • Most parameters (i.e. process_inputs , process_outputs , n_agents_per_process , costs ) can take a single value, a tuple of two values, or a list of values. If it has a single value, it is repeated for all processes/factories as appropriate. If it is a tuple of two numbers $(i, j)$, each process will take a number sampled from a uniform distribution supported on $[i, j]$ inclusive. If it is a list of values, of the length n_processes , it is used as it is otherwise, it is used to sample values for each process.