scml.scml2020.agents

Submodules

Package Contents

Classes

RandomAgent

An agent that negotiates randomly.

DoNothingAgent

An agent that does nothing for the whole length of the simulation

IndependentNegotiationsAgent

Implements the base class for agents that negotiate independently with different partners.

MarketAwareIndependentNegotiationsAgent

Implements the base class for agents that negotiate independently with different partners using trading/catalog

BuyCheapSellExpensiveAgent

An agent that tries to buy cheap and sell expensive but does not care about production scheduling.

MarketAwareBuyCheapSellExpensiveAgent

An agent that tries to buy cheap and sell expensive but does not care about production scheduling.

DecentralizingAgent

A negotiation manager that controls a controller and another for selling for every timestep

IndDecentralizingAgent

A negotiation manager that manages independent negotiators that do not share any information once created

DecentralizingAgentWithLogging

A negotiation manager that controls a controller and another for selling for every timestep

MarketAwareDecentralizingAgent

Predicts an amount based on publicly available market information. Falls

MarketAwareIndDecentralizingAgent

Signs all contracts that have good prices

ReactiveAgent

A negotiation manager that controls a controller and another for selling for every timestep

MarketAwareReactiveAgent

Signs all contracts that have good prices

MovingRangeAgent

My negotiation strategy

MarketAwareMovingRangeAgent

Predicts an amount based on publicly available market information. Falls

SatisficerAgent

A simple monolithic agent that tries to carefully make small profit

Attributes

__all__

class scml.scml2020.agents.RandomAgent(*args, **kwargs)[source]

Bases: scml.scml2020.agents.indneg.IndependentNegotiationsAgent

An agent that negotiates randomly.

create_ufun(is_seller: bool, issues=None, outcomes=None)[source]

Creates a utility function

class scml.scml2020.agents.DoNothingAgent(name: str | None = None, type_postfix: str = '', preferences: negmas.preferences.Preferences | None = None, ufun: negmas.preferences.UtilityFunction | None = None)[source]

Bases: scml.scml2020.agent.SCML2020Agent

An agent that does nothing for the whole length of the simulation

respond_to_negotiation_request(initiator: str, issues: List[negmas.Issue], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface) negmas.Negotiator | None[source]

Called whenever another agent requests a negotiation with this agent.

Parameters:
  • initiator – The ID of the agent that requested this negotiation

  • issues – Negotiation issues

  • annotation – Annotation attached with this negotiation

  • mechanism – The NegotiatorMechanismInterface interface to the mechanism to be used for this negotiation.

Returns:

None to reject the negotiation, otherwise a negotiator

sign_all_contracts(contracts: List[negmas.Contract]) List[str | None][source]

Signs all contracts

on_contracts_finalized(signed: List[negmas.Contract], cancelled: List[negmas.Contract], rejectors: List[List[str]]) None[source]

Called for all contracts in a single step to inform the agent about which were finally signed and which were rejected by any agents (including itself)

Parameters:
  • signed – A list of signed contracts. These are binding

  • cancelled – A list of cancelled contracts. These are not binding

  • rejectors – A list of lists where each of the internal lists gives the rejectors of one of the cancelled contracts. Notice that it is possible that this list is empty which means that the contract other than being rejected by any agents (if that was possible in the specific world).

Remarks:

The default implementation is to call on_contract_signed for singed contracts and on_contract_cancelled for cancelled contracts

step()[source]

Called by the simulator at every simulation step

init()[source]

Called to initialize the agent after the world is initialized. the AWI is accessible at this point.

on_agent_bankrupt(agent: str, contracts: List[negmas.Contract], quantities: List[int], compensation_money: int) None[source]

Called whenever a contract is nullified (because the partner is bankrupt)

Parameters:
  • agent – The ID of the agent that went bankrupt.

  • contracts – All future contracts between this agent and the bankrupt agent.

  • quantities – The actual quantities that these contracts will be executed at.

  • compensation_money – The compensation money that is already added to the agent’s wallet (if ANY).

Remarks:

  • compensation_money will be nonzero iff immediate_compensation is enabled for this world

on_failures(failures: List[scml.scml2020.common.Failure]) None[source]

Called whenever there are failures either in production or in execution of guaranteed transactions

Parameters:

failures – A list of Failure s.

on_negotiation_failure(partners: List[str], annotation: Dict[str, Any], mechanism: negmas.NegotiatorMechanismInterface, state: negmas.MechanismState) None[source]

Called whenever a negotiation ends without agreement

on_negotiation_success(contract: negmas.Contract, mechanism: negmas.NegotiatorMechanismInterface) None[source]

Called whenever a negotiation ends with agreement

on_contract_cancelled(contract: negmas.Contract, rejectors: List[str]) None[source]

Called whenever at least a partner did not sign the contract

on_contract_executed(contract: negmas.Contract) None[source]

Called after successful contract execution for which the agent is one of the partners.

on_contract_breached(contract: negmas.Contract, breaches: List[negmas.Breach], resolution: negmas.Contract | None) None[source]

Called after complete processing of a contract that involved a breach.

Parameters:
  • contract – The contract

  • breaches – All breaches committed (even if they were resolved)

  • resolution – The resolution contract if re-negotiation was successful. None if not.

class scml.scml2020.agents.IndependentNegotiationsAgent(*args, **kwargs)[source]

Bases: scml.scml2020.components.negotiation.IndependentNegotiationsManager, scml.scml2020.components.prediction.FixedTradePredictionStrategy, scml.scml2020.components.trading.ReactiveTradingStrategy, scml.scml2020.world.SCML2020Agent

Implements the base class for agents that negotiate independently with different partners.

These agents do not take production capacity, availability of materials or any other aspects of the simulation into account. They are to serve only as baselines.

Remarks:

  • IndependentNegotiationsAgent agents assume that each production process has one input type with the same

    index as itself and one output type with one added to the index (i.e. process $i$ takes product $i$ as input and creates product $i+1$ as output.

  • It does not assume that all lines have the same production cost (it uses the average cost though).

  • It does not assume that the agent has a single production process.

acceptable_unit_price(step: int, sell: bool) int[source]

Returns the maximum/minimum acceptable unit price for buying/selling at the given time-step

Parameters:
  • step – Simulation step

  • sell – Sell or buy

target_quantity(step: int, sell: bool) int[source]

Returns the target quantity to sell/buy at a given time-step

Parameters:
  • step – Simulation step

  • sell – Sell or buy

class scml.scml2020.agents.MarketAwareIndependentNegotiationsAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.components.signing.KeepOnlyGoodPrices, IndependentNegotiationsAgent

Implements the base class for agents that negotiate independently with different partners using trading/catalog prices to control signing

These agents do not take production capacity, availability of materials or any other aspects of the simulation into account. They are to serve only as baselines.

Remarks:

  • IndependentNegotiationsAgent agents assume that each production process has one input type with the same

    index as itself and one output type with one added to the index (i.e. process $i$ takes product $i$ as input and creates product $i+1$ as output.

  • It does not assume that all lines have the same production cost (it uses the average cost though).

  • It does not assume that the agent has a single production process.

class scml.scml2020.agents.BuyCheapSellExpensiveAgent(*args, **kwargs)[source]

Bases: scml.scml2020.agents.indneg.IndependentNegotiationsAgent

An agent that tries to buy cheap and sell expensive but does not care about production scheduling.

create_ufun(is_seller: bool, issues=None, outcomes=None)[source]

Creates a utility function

class scml.scml2020.agents.MarketAwareBuyCheapSellExpensiveAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.agents.indneg.MarketAwareIndependentNegotiationsAgent, BuyCheapSellExpensiveAgent

An agent that tries to buy cheap and sell expensive but does not care about production scheduling.

class scml.scml2020.agents.DecentralizingAgent(*args, negotiator_type: negmas.SAONegotiator | str = AspirationNegotiator, negotiator_params: Dict[str, Any] | None = None, **kwargs)[source]

Bases: _NegotiationCallbacks, scml.scml2020.components.StepNegotiationManager, scml.scml2020.components.trading.PredictionBasedTradingStrategy, scml.scml2020.components.SupplyDrivenProductionStrategy, scml.scml2020.world.SCML2020Agent

A negotiation manager that controls a controller and another for selling for every timestep

Parameters:
  • negotiator_type – The negotiator type to use to manage all negotiations

  • negotiator_params – Paramters of the negotiator

Provides:
Requires:
Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.IndDecentralizingAgent(*args, negotiator_type: negmas.SAONegotiator | str = AspirationNegotiator, negotiator_params: Dict[str, Any] | None = None, **kwargs)[source]

Bases: _NegotiationCallbacks, scml.scml2020.components.IndependentNegotiationsManager, scml.scml2020.components.trading.PredictionBasedTradingStrategy, scml.scml2020.components.SupplyDrivenProductionStrategy, scml.scml2020.world.SCML2020Agent

A negotiation manager that manages independent negotiators that do not share any information once created

Parameters:
  • negotiator_type – The negotiator type to use to manage all negotiations

  • negotiator_params – Parameters of the negotiator

Requires:
Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

create_ufun(is_seller: bool, issues=None, outcomes=None)[source]

Creates a utility function

class scml.scml2020.agents.DecentralizingAgentWithLogging(*args, **kwargs)[source]

Bases: _NegotiationCallbacks, scml.scml2020.components.StepNegotiationManager, scml.scml2020.components.trading.PredictionBasedTradingStrategy, scml.scml2020.components.SupplyDrivenProductionStrategy, scml.scml2020.world.SCML2020Agent

A negotiation manager that controls a controller and another for selling for every timestep

Parameters:
  • negotiator_type – The negotiator type to use to manage all negotiations

  • negotiator_params – Paramters of the negotiator

Provides:
Requires:
Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.MarketAwareDecentralizingAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.components.prediction.MarketAwareTradePredictionStrategy, _NegotiationCallbacks, scml.scml2020.components.MovingRangeNegotiationManager, scml.scml2020.components.trading.PredictionBasedTradingStrategy, scml.scml2020.components.signing.KeepOnlyGoodPrices, scml.scml2020.components.SupplyDrivenProductionStrategy, scml.scml2020.world.SCML2020Agent

Predicts an amount based on publicly available market information. Falls back to fixed prediction if no information is available

Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.MarketAwareIndDecentralizingAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.components.signing.KeepOnlyGoodPrices, scml.scml2020.components.prediction.MarketAwareTradePredictionStrategy, IndDecentralizingAgent

Signs all contracts that have good prices

Overrides:
- buying_margin

The margin from the catalog price to allow for buying. The agent will never buy at a price higher than the catalog price by more than this margin (relative to catalog price).

- selling_margin

The margin from the catalog price to allow for selling. The agent will never sell at a price lower than the catalog price by more than this margin (relative to catalog price).

Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.ReactiveAgent(*args, negotiator_type: negmas.SAONegotiator | str = AspirationNegotiator, negotiator_params: Dict[str, Any] | None = None, **kwargs)[source]

Bases: scml.scml2020.components.StepNegotiationManager, scml.scml2020.components.trading.ReactiveTradingStrategy, scml.scml2020.components.production.TradeDrivenProductionStrategy, scml.scml2020.components.FixedTradePredictionStrategy, scml.scml2020.world.SCML2020Agent

A negotiation manager that controls a controller and another for selling for every timestep

Parameters:
  • negotiator_type – The negotiator type to use to manage all negotiations

  • negotiator_params – Paramters of the negotiator

Provides:
Requires:
Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

acceptable_unit_price(step: int, sell: bool) int[source]

Returns the maximum/minimum acceptable unit price for buying/selling at the given time-step

Parameters:
  • step – Simulation step

  • sell – Sell or buy

target_quantity(step: int, sell: bool) int[source]

Returns the target quantity to sell/buy at a given time-step

Parameters:
  • step – Simulation step

  • sell – Sell or buy

target_quantities(steps: Tuple[int, int], sell: bool) numpy.ndarray[source]

Implemented for speed but not really required

class scml.scml2020.agents.MarketAwareReactiveAgent(*args, buying_margin=None, selling_margin=None, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.components.signing.KeepOnlyGoodPrices, ReactiveAgent

Signs all contracts that have good prices

Overrides:
- buying_margin

The margin from the catalog price to allow for buying. The agent will never buy at a price higher than the catalog price by more than this margin (relative to catalog price).

- selling_margin

The margin from the catalog price to allow for selling. The agent will never sell at a price lower than the catalog price by more than this margin (relative to catalog price).

Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.MovingRangeAgent(*args, price_weight=0.7, utility_threshold=0.9, time_threshold=0.9, time_horizon=0.1, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.components.MovingRangeNegotiationManager, scml.scml2020.components.trading.PredictionBasedTradingStrategy, scml.scml2020.components.SupplyDrivenProductionStrategy, scml.scml2020.world.SCML2020Agent

My negotiation strategy

Parameters:
  • price_weight – The relative importance of price in the utility calculation.

  • utility_threshold – The fraction of maximum utility above which all offers will be accepted.

  • time_threshold – The fraction of the negotiation time after which any valid offers will be accepted.

  • time_range – The time-range for each controller as a fraction of the number of simulation steps

Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.MarketAwareMovingRangeAgent(*args, min_price_margin=0.5, max_price_margin=0.5, **kwargs)[source]

Bases: scml.scml2020.components.prediction.MarketAwareTradePredictionStrategy, MovingRangeAgent

Predicts an amount based on publicly available market information. Falls back to fixed prediction if no information is available

Hooks Into:
Remarks:
  • Attributes section describes the attributes that can be used to construct the component (passed to its __init__ method).

  • Provides section describes the attributes (methods, properties, data-members) made available by this component directly. Note that everything provided by the bases of this components are also available to the agent (Check the Bases section above for all the bases of this component).

  • Requires section describes any requirements from the agent using this component. It defines a set of methods or properties/data-members that must exist in the agent that uses this component. These requirement are usually implemented as abstract methods in the component

  • Abstract section describes abstract methods that MUST be implemented by any descendant of this component.

  • Hooks Into section describes the methods this component overrides calling super () which allows other components to hook into the same method (by overriding it). Usually callbacks starting with on_ are hooked into this way.

  • Overrides section describes the methods this component overrides without calling super effectively disallowing any other components after it in the MRO to call this method. Usually methods that do some action (i.e. not starting with on_) are overridden this way.

class scml.scml2020.agents.SatisficerAgent(*args, target_productivity=1.0, satisfying_profit=0.15, acceptable_loss=0.02, price_range=0.4, concession_rate_price=1.0, concession_rate_quantity=1.0, concession_rate_time=1.0, market_share=1, horizon=5, **kwargs)[source]

Bases: scml.scml2020.agent.SCML2020Agent

A simple monolithic agent that tries to carefully make small profit every step.

Parameters:
  • target_productivity – The productivity level targeted by the agent defined as the fraction of its lines to be active per step.

  • satisfying_profit – A profit amount considered satisfactory. Used when deciding negotiation agenda and signing to decide if a price is a good price (see _good_price()). A fraction of the trading price.

  • acceptable_loss – A fraction of trading price that the seller/buyer is willing to go under/over the current trading price during negotiation.

  • price_range – The total range around the trading price for negotiation agendas.

  • concession_rate_price – The exponent of the consession curve for price.

  • concession_rate_quantity – The exponent of the consession curve for quantity.

  • concession_rate_time – The exponent of the consession curve for time.

  • market_share – An integer specifying the expected share of the agent in the market. The agent will assume that it can get up to (market_share / (n_competitors + market_share -1)) of all sales and supplies where n_competitors is the number of agents at the same production level. Setting it to 1 means that the agent assumes it will get the same amount of trade as all other agents. Setting it to infinity means that the agent will assume it will take all the trade in the market

  • horizon – Time horizon for negotiations. If None, the exogenous_contracts_revelation horizon will be used

init()[source]

Called once

before_step()[source]

Called at at the BEGINNING of every production step (day)

step()[source]

Called at the end of the day. Will request all negotiations

respond_to_negotiation_request(initiator, issues, annotation, mechanism)[source]

Called whenever another agent requests a negotiation with this agent.

Parameters:
  • initiator – The ID of the agent that requested this negotiation

  • issues – Negotiation issues

  • annotation – Annotation attached with this negotiation

  • mechanism – The NegotiatorMechanismInterface interface to the mechanism to be used for this negotiation.

Returns:

None to reject the negotiation, otherwise a negotiator

sign_all_contracts(contracts)[source]

Signs all contracts

on_contracts_finalized(signed, cancelled, rejectors)[source]

Called for all contracts in a single step to inform the agent about which were finally signed and which were rejected by any agents (including itself)

Parameters:
  • signed – A list of signed contracts. These are binding

  • cancelled – A list of cancelled contracts. These are not binding

  • rejectors – A list of lists where each of the internal lists gives the rejectors of one of the cancelled contracts. Notice that it is possible that this list is empty which means that the contract other than being rejected by any agents (if that was possible in the specific world).

Remarks:

The default implementation is to call on_contract_signed for singed contracts and on_contract_cancelled for cancelled contracts

do_production() int[source]
propose(state: negmas.sao.SAOState, ami: negmas.sao.SAONMI, is_selling: bool, is_requested: bool)[source]

Used to propose to the opponent

Parameters:
  • state – mechanism state including current round

  • ami – Agent-mechanism-interface for accessing the negotiation mechanism

  • offer – The offer proposed by the partner

  • is_selling – Whether the agent is selling to this partner

  • is_requested – Whether the agent requested this negotiation

respond(state, ami, is_selling, is_requested)[source]

Responds to an offer from one partner.

Parameters:
  • state – mechanism state including current round

  • ami – Agent-mechanism-interface for accessing the negotiation mechanism

  • offer – The offer proposed by the partner

  • is_selling – Whether the agent is selling to this partner

  • is_requested – Whether the agent requested this negotiation

Remarks:

  • The main idea is to accept offers that are within the quantity limits for the delivery day if its price is good enough for the current stage of the negotiation.

  • During negotiation, the agent starts accepting highest/lowest prices for selling/buying and gradually conceeds to the minimally acceptable price (good_price) defined as being acceptable_loss above/below the trading price for buying/selling.

on_negotiation_failure(partners, annotation, mechanism, state)[source]

Called when a negotiation fails

on_negotiation_success(contract, mechanism)[source]

Called when a negotiation fails

_remove_tentative_offer(selling, partner)[source]

Removes my last offer from the tentative offers

_is_good_price(is_selling: bool, u: float, slack: float = 0.0)[source]

Checks whether a price is good relative to current trading prices, and satisfying profit (with possible slack).

scml.scml2020.agents.__all__[source]