scml.oneshot.common
Module Contents
Classes
A report published periodically by the system showing the financial standing of an agent |
|
Exogenous contract information |
|
Defines all private information of a factory |
|
State of a one-shot agent |
Functions
|
Checks whether an agent is a system agent or not |
Attributes
Index of quantity in negotiation issues |
|
Index of time in negotiation issues |
|
Index of unit price in negotiation issues |
|
A constant indicating an invalid cost for lines incapable of running some process |
|
ID of the system seller agent |
|
ID of the system buyer agent |
- scml.oneshot.common.INFINITE_COST[source]
A constant indicating an invalid cost for lines incapable of running some process
- scml.oneshot.common.is_system_agent(aid: str) bool [source]
Checks whether an agent is a system agent or not
- Parameters:
aid – Agent ID
- Returns:
True if the ID is for a system agent.
- class scml.oneshot.common.FinancialReport[source]
A report published periodically by the system showing the financial standing of an agent
- __slots__ = ['agent_id', 'step', 'cash', 'assets', 'breach_prob', 'breach_level', 'is_bankrupt', 'agent_name'][source]
- breach_prob: float[source]
Number of times the agent breached a contract over the total number of contracts it signed.
- breach_level: float[source]
Sum of the agent’s breach levels so far divided by the number of contracts it signed.
- class scml.oneshot.common.OneShotExogenousContract[source]
Exogenous contract information
- __slots__ = ['quantity', 'unit_price', 'product', 'seller', 'buyer', 'time', 'revelation_time'][source]
- seller: str[source]
Seller ID (when passing contrtacts to the constructor of SCML2020OneShotWorld, you can also pass an interged index referring to the agent’s index in the
agent_types
list)
- buyer: str[source]
Buyer ID (when passing contrtacts to the constructor of SCML2020OneShotWorld, you can also pass an interged index referring to the agent’s index in the
agent_types
list)
- revelation_time: int[source]
Simulation step at which the contract is revealed to its owner. Should not exceed
time
and the defaultgenerate()
method sets it to time
- class scml.oneshot.common.OneShotProfile[source]
Defines all private information of a factory
- shortfall_penalty_mean: float[source]
A positive number specifying the average penalty for selling too much.
- disposal_cost_mean: float[source]
A positive number specifying the average penalty buying too much.
- shortfall_penalty_dev: float[source]
A positive number specifying the std. dev. of penalty for selling too much.
- disposal_cost_dev: float[source]
A positive number specifying the std. dev. penalty buying too much.
- storage_cost_mean: float[source]
A positive number specifying the average cost for keeping inventory for one step. This is only used if the products are not
perishable
.
- storage_cost_dev: float[source]
A positive number specifying the std. dev. cost for keeping inventory for one step. This is only used if the products are not
perishable
.
- classmethod random(input_product: int, oneshot: bool) OneShotProfile [source]
- class scml.oneshot.common.OneShotState[source]
State of a one-shot agent
- property running_buy_states: dict[str, negmas.sao.common.SAOState][source]
All running buy negotiations as a mapping from partner ID to current negotiation state
- property current_sell_states: dict[str, negmas.sao.common.SAOState][source]
All running sell negotiations as a mapping from partner ID to current negotiation state
- property current_states: dict[str, negmas.sao.common.SAOState][source]
All running negotiations as a mapping from partner ID to current negotiation state
- property current_buy_nmis: dict[str, negmas.sao.SAONMI][source]
All running buy negotiations as a mapping from partner ID to current negotiation nmi
- property current_sell_nmis: dict[str, negmas.sao.SAONMI][source]
All running sell negotiations as a mapping from partner ID to current negotiation nmi
- property current_nmis: dict[str, negmas.sao.SAONMI][source]
All running negotiations as a mapping from partner ID to current negotiation state
- property current_buy_offers: dict[str, negmas.outcomes.Outcome][source]
All current buy negotiations as a mapping from partner ID to current offer
- property current_sell_offers: dict[str, negmas.outcomes.Outcome][source]
All current sell negotiations as a mapping from partner ID to current offer
- property current_offers: dict[str, negmas.outcomes.Outcome][source]
All current negotiations as a mapping from partner ID to current offer
- total_future_sales: int[source]
Total quantity registered as sales in the future using
awi.register_sale
.
- total_future_supplies: int[source]
Total quantity registered as supplies in the future using
awi.register_supply
.
- price_multiplier: float[source]
The multiplier multiplied by the trading/catalog price when the negotiation agendas are created to decide the maximum and lower quantities.
- is_exogenous_forced: bool[source]
exogenous contracts always forced or can the agent decide not to sign them.
- current_step: int[source]
Current simulation step (inherited from
negmas.situated.AgentWorldInterface
).
- n_steps: int[source]
Number of simulation steps (inherited from
negmas.situated.AgentWorldInterface
).
- relative_simulation_time: float[source]
Fraction of the simulation completed (inherited from
negmas.situated.AgentWorldInterface
).
- profile: OneShotProfile[source]
Gives the agent profile including its production cost, number of production lines, input product index, mean of its delivery penalties, mean of its disposal costs, standard deviation of its shortfall penalties and standard deviation of its disposal costs. See
OneShotProfile
for full description. This information is private information and no other agent knows it.
- is_first_level: bool[source]
Is the agent in the first production level (i.e. it is an input agent that buys the raw material).
- is_last_level: bool[source]
Is the agent in the last production level (i.e. it is an output agent that sells the final product).
- my_suppliers: list[str][source]
A list of IDs for all suppliers to the agent (i.e. agents that can sell the input product of the agent).
- my_consumers: list[str][source]
A list of IDs for all consumers to the agent (i.e. agents that can buy the output product of the agent).
- my_partners: list[str][source]
A list of IDs for all negotiation partners of the agent (in the order suppliers then consumers).
- penalties_scale: Literal[trading, catalog, unit, none][source]
The scale at which to calculate disposal cost/delivery penalties. “trading” and “catalog” mean trading and catalog prices. “unit” means the contract’s unit price while “none” means that disposal cost/shortfall penalty are absolute.
- trading_prices: list[float][source]
The trading prices of all products. This information is only available if
publish_trading_prices
is set in the world.
- exogenous_contract_summary: list[tuple[int, int]][source]
A list of n_products lists each giving the total quantity and average price of exogenous contracts for a product. This information is only available if
publish_exogenous_summary
is set in the world.
- reports_of_agents: dict[str, dict[int, FinancialReport]][source]
Gives all past financial reports of a given agent. See
FinancialReport
for details.
- current_input_outcome_space: negmas.outcomes.DiscreteCartesianOutcomeSpace[source]
The current issues for all negotiations to buy the input product of the agent. If the agent is at level zero, this will be empty. This is exactly the same as current_input_outcome_space.issues
- current_output_outcome_space: negmas.outcomes.DiscreteCartesianOutcomeSpace[source]
The current issues for all negotiations to buy the output product of the agent. If the agent is at level n_products - 1, this will be empty. This is exactly the same as current_output_outcome_space.issues
- current_negotiation_details: dict[str, dict[str, NegotiationDetails]][source]
Details on all current negotiations separated into “buy” and “sell” dictionaries.
- needed_sales: int[source]
Today’s needed sales as of now (exogenous input - exogenous output - total sales so far).
- needed_supplies: int[source]
Today needed supplies as of now (exogenous output - exogenous input - total supplies).
- storage_cost: float = 0.0[source]
Current unit storage cost. Only used in standard worlds where products are not perishable
- classmethod random(oneshot: bool | None = None) OneShotState [source]