SatisficerAgent

class scml.scml2020.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.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

Methods Summary

before_step()

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

do_production()

rtype

int

init()

Called once

on_contracts_finalized(signed, cancelled, …)

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)

on_negotiation_failure(partners, annotation, …)

Called when a negotiation fails

on_negotiation_success(contract, mechanism)

Called when a negotiation fails

propose(state, ami, is_selling, is_requested)

Used to propose to the opponent

respond(state, ami, offer, is_selling, …)

Responds to an offer from one partner.

respond_to_negotiation_request(initiator, …)

Called whenever another agent requests a negotiation with this agent.

sign_all_contracts(contracts)

Signs all contracts

step()

Called at the end of the day.

Methods Documentation

before_step()[source]

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

do_production()[source]
Return type

int

init()[source]

Called once

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

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

Called when a negotiation fails

on_negotiation_success(contract, mechanism)[source]

Called when a negotiation fails

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

Used to propose to the opponent

Parameters
  • state (SAOState) – mechanism state including current round

  • ami (SAOAMI) – Agent-mechanism-interface for accessing the negotiation mechanism

  • offer – The offer proposed by the partner

  • is_selling (bool) – Whether the agent is selling to this partner

  • is_requested (bool) – Whether the agent requested this negotiation

respond(state, ami, offer, 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.

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 AgentMechanismInterface 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

step()[source]

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