OneShotState

class scml.oneshot.OneShotState(exogenous_input_quantity, exogenous_input_price, exogenous_output_quantity, exogenous_output_price, disposal_cost, shortfall_penalty, current_balance, total_sales, total_supplies, n_products, n_processes, n_competitors, all_suppliers, all_consumers, bankrupt_agents, catalog_prices, price_multiplier, is_exogenous_forced, current_step, n_steps, relative_simulation_time, profile, n_lines, is_first_level, is_last_level, is_middle_level, my_input_product, my_output_product, level, my_suppliers, my_consumers, penalties_scale, n_input_negotiations, n_output_negotiations, trading_prices, exogenous_contract_summary, reports_of_agents, current_input_outcome_space, current_output_outcome_space, current_negotiation_details, sales, supplies, needed_sales, needed_supplies, running_negotiations)[source]

Bases: object

State of a one-shot agent

Attributes Summary

all_consumers

A list of all consumers by product.

all_suppliers

A list of all suppliers by product.

bankrupt_agents

list of bankrupt agents

catalog_prices

A list of the catalog prices (by product).

current_balance

Current balance of the agent.

current_input_outcome_space

The current issues for all negotiations to buy the input product of the agent.

current_negotiation_details

Details on all current negotiations separated into "buy" and "sell" dictionaries.

current_output_outcome_space

The current issues for all negotiations to buy the output product of the agent.

current_step

Current simulation step (inherited from negmas.situated.AgentWorldInterface ).

disposal_cost

Current unit disposal cost

exogenous_contract_summary

A list of n_products lists each giving the total quantity and average price of exogenous contracts for a product.

exogenous_input_price

Exogenous input unit price for the current step

exogenous_input_quantity

Exogenous input quantity for the current step

exogenous_output_price

Exogenous output unit price for the current step

exogenous_output_quantity

Exogenous output quantity for the current step

is_exogenous_forced

exogenous contracts always forced or can the agent decide not to sign them.

is_first_level

Is the agent in the first production level (i.e.

is_last_level

Is the agent in the last production level (i.e.

is_middle_level

Is the agent neither a first level nor a last level agent

level

The production level which is numerically the same as the input product.

my_consumers

A list of IDs for all consumers to the agent (i.e.

my_input_product

The input product to the factory controlled by the agent.

my_output_product

The output product from the factory controlled by the agent.

my_suppliers

A list of IDs for all suppliers to the agent (i.e.

n_competitors

Number of other factories on the same production level.

n_input_negotiations

Number of negotiations with suppliers.

n_lines

The number of production lines in the factory (private information).

n_output_negotiations

Number of negotiations with consumers.

n_processes

Number of processes in the production chain.

n_products

Number of products in the production chain.

n_steps

Number of simulation steps (inherited from negmas.situated.AgentWorldInterface ).

needed_sales

Today's needed sales as of now (exogenous input - exogenous output - total sales so far).

needed_supplies

Today's needed supplies as of now (exogenous output - exogenous input - total supplies).

penalties_scale

The scale at which to calculate disposal cost/delivery penalties.

price_multiplier

The multiplier multiplied by the trading/catalog price when the negotiation agendas are created to decide the maximum and lower quantities.

profile

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.

relative_simulation_time

Fraction of the simulation completed (inherited from negmas.situated.AgentWorldInterface).

reports_of_agents

Gives all past financial reports of a given agent.

running_negotiations

Maps partner ID to the state of the running negotiation with it (if any)

sales

Today's sales per customer so far.

shortfall_penalty

Current unit shortfall penalty

supplies

Today's supplies per supplier so far.

total_sales

Total quantity registered as sales using awi.register_sale.

total_supplies

Total quantity registered as supplies using awi.register_supply.

trading_prices

The trading prices of all products.

Attributes Documentation

all_consumers: list[list[str]]

A list of all consumers by product.

all_suppliers: list[list[str]]

A list of all suppliers by product.

bankrupt_agents: list[str]

list of bankrupt agents

catalog_prices: list[float]

A list of the catalog prices (by product).

current_balance: int

Current balance of the agent.

current_input_outcome_space: DiscreteCartesianOutcomeSpace

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_negotiation_details: dict[str, dict[str, scml.oneshot.common.NegotiationDetails]]

Details on all current negotiations separated into “buy” and “sell” dictionaries.

current_output_outcome_space: DiscreteCartesianOutcomeSpace

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_step: int

Current simulation step (inherited from negmas.situated.AgentWorldInterface ).

disposal_cost: float

Current unit disposal cost

exogenous_contract_summary: list[tuple[int, int]]

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.

exogenous_input_price: int

Exogenous input unit price for the current step

exogenous_input_quantity: int

Exogenous input quantity for the current step

exogenous_output_price: int

Exogenous output unit price for the current step

exogenous_output_quantity: int

Exogenous output quantity for the current step

is_exogenous_forced: bool

exogenous contracts always forced or can the agent decide not to sign them.

is_first_level: bool

Is the agent in the first production level (i.e. it is an input agent that buys the raw material).

is_last_level: bool

Is the agent in the last production level (i.e. it is an output agent that sells the final product).

is_middle_level: bool

Is the agent neither a first level nor a last level agent

level: int

The production level which is numerically the same as the input product.

my_consumers: list[str]

A list of IDs for all consumers to the agent (i.e. agents that can buy the output product of the agent).

my_input_product: int

The input product to the factory controlled by the agent.

my_output_product: int

The output product from the factory controlled by the agent.

my_suppliers: list[str]

A list of IDs for all suppliers to the agent (i.e. agents that can sell the input product of the agent).

n_competitors: int

Number of other factories on the same production level.

n_input_negotiations: int

Number of negotiations with suppliers.

n_lines: int

The number of production lines in the factory (private information).

n_output_negotiations: int

Number of negotiations with consumers.

n_processes: int

Number of processes in the production chain.

n_products: int

Number of products in the production chain.

n_steps: int

Number of simulation steps (inherited from negmas.situated.AgentWorldInterface ).

needed_sales: int

Today’s needed sales as of now (exogenous input - exogenous output - total sales so far).

needed_supplies: int

Today’s needed supplies as of now (exogenous output - exogenous input - total supplies).

penalties_scale: Literal['trading', 'catalog', 'unit', 'none']

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.

price_multiplier: float

The multiplier multiplied by the trading/catalog price when the negotiation agendas are created to decide the maximum and lower quantities.

profile: OneShotProfile

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.

relative_simulation_time: float

Fraction of the simulation completed (inherited from negmas.situated.AgentWorldInterface).

reports_of_agents: dict[str, dict[int, scml.scml2019.common.FinancialReport]]

Gives all past financial reports of a given agent. See FinancialReport for details.

running_negotiations: dict[str, negmas.sao.common.SAOState]

Maps partner ID to the state of the running negotiation with it (if any)

sales: dict[str, int]

Today’s sales per customer so far.

shortfall_penalty: float

Current unit shortfall penalty

supplies: dict[str, int]

Today’s supplies per supplier so far.

total_sales: int

Total quantity registered as sales using awi.register_sale.

total_supplies: int

Total quantity registered as supplies using awi.register_supply.

trading_prices: list[float]

The trading prices of all products. This information is only available if publish_trading_prices is set in the world.