smia.behaviours.handle_negotiation_behaviour module

class smia.behaviours.handle_negotiation_behaviour.HandleNegotiationBehaviour(agent_object, negotiation_info)[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 AAS Manager 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 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 AAS Manager has been the winner of the negotiation.