operator_gui_behaviours module

class operator_gui_behaviours.OperatorGUIBehaviour[source]

Bases: OneShotBehaviour

The behavior for the Operator only needs to add the web interface to the SMIA SPADE agent and the GUI related resources (HTML web pages and drivers).

async run() None[source]

Body of the behaviour. To be implemented by user.

class operator_gui_behaviours.OperatorReceiveBehaviour[source]

Bases: CyclicBehaviour

async on_start() None[source]

Coroutine called before the behaviour is started.

async run() None[source]

Body of the behaviour. To be implemented by user.

async unlock_behaviour(thread, behav_name, msg)[source]
class operator_gui_behaviours.OperatorRequestBehaviour(agent_object, req_data)[source]

Bases: OneShotBehaviour

This behaviour handles the CSS-related requests through FIPA-ACL messages.

async run() None[source]

Body of the behaviour. To be implemented by user.

async adapt_msg_to_fipa_smiacl(msg_body_json: dict) dict[source]
This method adapts a FIPA-ACL message into one that is compatible with the FIPA-SMIACL normalized language

(used in SMIA versions later than 0.2.4).

Parameters:

msg_body_json – dict with body of the message.

Returns:

dict with adapted body of the message.

Return type:

msg_body_json

static create_acl_msg(receiver_jid, thread, metadata, body_json)[source]

This method creates an FIPA-ACL SPADE message.

Parameters:
  • receiver_jid (str) – the JID of the SMIA agent receiver.

  • thread (str) – thread of the message.

  • metadata – metadata of the message.

  • body_json (dict) – the body of the message in JSON format.

Returns:

the SPADE message object.

Return type:

spade.message.Message

get_smia_version_by_id(smia_id)[source]

This method get the SMIA version y its identifier.

Parameters:

smia_id (str) – identifier of the SMIA instance.

Returns:

version in string format.

Return type:

str

static version_str_to_tuple(version_str)[source]

This method converts a version string to tuple in order to make comparisons.

Parameters:

version_str (str) – string version to convert.

Returns:

version in tuple format.

Return type:

tuple