scml.scml2020.agents.satisficer =============================== .. py:module:: scml.scml2020.agents.satisficer Classes ------- .. autoapisummary:: scml.scml2020.agents.satisficer.SatisficerAgent Module Contents --------------- .. py:class:: 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) Bases: :py:obj:`scml.scml2020.agent.SCML2020Agent` A simple monolithic agent that tries to *carefully* make small profit every step. :param target_productivity: The productivity level targeted by the agent defined as the fraction of its lines to be active per step. :param 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. :param acceptable_loss: A fraction of trading price that the seller/buyer is willing to go under/over the current trading price during negotiation. :param price_range: The total range around the trading price for negotiation agendas. :param concession_rate_price: The exponent of the consession curve for price. :param concession_rate_quantity: The exponent of the consession curve for quantity. :param concession_rate_time: The exponent of the consession curve for time. :param 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 :param horizon: Time horizon for negotiations. If None, the exogenous_contracts_revelation horizon will be used .. py:attribute:: horizon :value: 5 .. py:attribute:: satisfying_profit :value: 0.15 .. py:attribute:: target_productivity :value: 1.0 .. py:attribute:: price_range :value: 0.4 .. py:attribute:: ep :value: 1.0 .. py:attribute:: eq :value: 1.0 .. py:attribute:: et :value: 1.0 .. py:attribute:: acceptable_loss :value: 0.02 .. py:attribute:: last_q .. py:attribute:: last_t .. py:attribute:: market_share :value: 1 .. py:method:: init() Called once .. py:method:: before_step() Called at at the BEGINNING of every production step (day) .. py:method:: step() Called at the end of the day. Will request all negotiations .. py:method:: respond_to_negotiation_request(initiator, issues, annotation, mechanism) Called whenever another agent requests a negotiation with this agent. :param initiator: The ID of the agent that requested this negotiation :param issues: Negotiation issues :param annotation: Annotation attached with this negotiation :param mechanism: The `NegotiatorMechanismInterface` interface to the mechanism to be used for this negotiation. :returns: None to reject the negotiation, otherwise a negotiator .. py:method:: sign_all_contracts(contracts) Signs all contracts .. py:method:: on_contracts_finalized(signed, cancelled, rejectors) 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) :param signed: A list of signed contracts. These are binding :param cancelled: A list of cancelled contracts. These are not binding :param 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 .. py:method:: do_production() -> int .. py:method:: propose(state: negmas.sao.SAOState, ami: negmas.sao.SAONMI, is_selling: bool, is_requested: bool) Used to propose to the opponent :param state: mechanism state including current round :param ami: Agent-mechanism-interface for accessing the negotiation mechanism :param offer: The offer proposed by the partner :param is_selling: Whether the agent is selling to this partner :param is_requested: Whether the agent requested this negotiation .. py:method:: respond(state, ami, is_selling, is_requested) Responds to an offer from one partner. :param state: mechanism state including current round :param ami: Agent-mechanism-interface for accessing the negotiation mechanism :param offer: The offer proposed by the partner :param is_selling: Whether the agent is selling to this partner :param 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. .. py:method:: on_negotiation_failure(partners, annotation, mechanism, state) Called when a negotiation fails .. py:method:: on_negotiation_success(contract, mechanism) Called when a negotiation fails .. py:method:: _remove_tentative_offer(selling, partner) Removes my last offer from the tentative offers .. py:method:: _is_good_price(is_selling: bool, u: float, slack: float = 0.0) Checks whether a price is good relative to current trading prices, and satisfying profit (with possible slack).