smia.behaviours.specific_handle_behaviours.handle_negotiation_behaviour module

class smia.behaviours.specific_handle_behaviours.handle_negotiation_behaviour.HandleNegotiationBehaviour(agent_object, negotiation_info, neg_req_data)[source]

Bases: CyclicBehaviour

This class implements the behaviour that handle a particular negotiation.

neg_value = None

value of the negotiation

neg_value_event = None
myagent = None

the SPADE agent object of the SMIA agent.

thread = None

thread of the negotiation

neg_requester_jid = None

JID of the SPADE agent that has requested the negotiation

targets = None

targets of the negotiation

neg_criteria = None

criteria of the negotiation

targets_processed = {}

targets that their values have been processed

async on_start()[source]

This method implements the initialization process of this behaviour.

async run()[source]

This method implements the logic of the behaviour.

async get_neg_value_with_criteria()[source]

This method gets the negotiation value based on a given criteria.

Returns:

value of the negotiation

Return type:

int

async send_response_msg_to_sender(performative, service_params)[source]

This method creates and sends a FIPA-ACL message with the given serviceParams and performative.

Parameters:
  • performative (str) – performative according to FIPA-ACL standard.

  • service_params (dict) – JSON with the serviceParams to be sent in the message.

async exit_negotiation(is_winner)[source]

This method is executed when the trade has ended, either as a winner or a loser. In any case, all the information of the negotiation is added to the global variable with all the information of all the negotiations

of the agent. The thread is used to differentiate the information of each negotiation, since this is the identifier of each one of them.

Parameters:

is_winner (bool) – it determines whether the SMIA has been the winner of the negotiation.