CommunicationTester names behaviour { T_Receive_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; T_Add_In : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; T_Remove_In : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; T_Decoded_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; T_Encoded_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; T_Read_Write : Connection[sequence[view[name : String, val : String]]]; T_Request : Connection[view[agent_id : String, foci : sequence[view[focus_name : String, focus_params : sequence[String]]]]]; T_Update : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; T_Add_Out : Connection[view[ID : Integer, sender : String, receiver : String, performative : String, content : String]]; msg : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]; knowledge_items : sequence[view[name : String, val : String]]; perception_request : view[agent_id : String, foci : sequence[view[focus_name : String, focus_params : sequence[String]]]]; //test input msg = view(ID : 77, protocol : "question_answer", sender : "Danny", receiver : "Zawar", performative : "ping", content : "Valoria"); knowledge_items = sequence(view(name : "Location", val : "KULeuven")); via out send "In CommunicationTester: "; via out send "message sent: "; via out send msg; via out send "\n\n"; via out send "In CommunicationTester: "; via out send "knowledge items available: "; via out send knowledge_items; via out send "\n\n"; compose { via T_Receive_Message send msg; via T_Read_Write send knowledge_items; via T_Request receive perception_request; via out send "In CommunicationTester: "; via out send "perception request received: "; via out send perception_request; via out send "\n\n"; and via MessageReceiving send Void where { T_Receive_Message renames Receive_Message, T_Add_In renames Add_In}; and via Inbox send Void where { T_Add_In renames Add_In, T_Remove_In renames Remove_In}; and via MessageDecoding send Void where { T_Remove_In renames Remove_In, T_Decoded_Message renames Decoded_Message}; and via Conversations send Void where { T_Update renames Update}; and via Communicating send Void where { T_Decoded_Message renames Decoded_Message, T_Read_Write renames Read_Write, T_Request renames Request, T_Update renames Update, T_Encoded_Message renames Encoded_Message}; and via MessageEncoding send Void where { T_Encoded_Message renames Encoded_Message, T_Add_Out renames Add_Out}; } } value MessageReceiving is abstraction () { Receive_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; Add_In : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; message_in : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]; //end view via Receive_Message receive message_in; //start test via out send "In MessageReceiving: "; via out send message_in; via out send "\n\n"; //end test unobservable; via Add_In send message_in; } value Inbox is abstraction () { Add_In : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; Remove_In : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; message : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]; message_in : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]; message_out : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]; message_inbox : sequence[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; via Add_In receive message_in; unobservable; //start test via out send "In Inbox (in): "; via out send message_in; via out send "\n\n"; message_out = message_in; //end test via Remove_In send message_out; //start test via out send "In Inbox (out): "; via out send message_out; via out send "\n\n"; //end test } value MessageDecoding is abstraction () { Remove_In : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]]; Decoded_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; message_in : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : String]; decoded_message_data : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]; via Remove_In receive message_in; //start test via out send "In MessageDecoding (in): "; via out send message_in; via out send "\n\n"; //via out send "Fin"; //end test unobservable; //start test decoded_message_data = view(ID : 77, protocol : "question_answer", sender : "Danny", receiver : "Zawar", performative : "ping", content : sequence(view(key : "Location", val : "Valoria"))); via out send "In MessageDecoding (out): "; via out send decoded_message_data; via out send "\n\n"; //via out send "Fin"; //end test via Decoded_Message send decoded_message_data; //start test code via out send "In MessageDecoding (out): "; via out send "decoded_message_data passed via Decoded_Message"; via out send "\n\n"; //end test code } value Conversations is abstraction () { Update : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; conversation_step : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]; //conversations_repository : sequence[sequence[view[protocol_name : String, ID : Integer, //encoded_message_data : view[ID : Integer, sender : String, receiver : String, //performative : String, content : sequence[view[key : String, val : any]]]]]]; //start test via out send "Entering Conversations... "; via out send "Start updating... "; via Update receive conversation_step; via out send "Updating: "; via out send conversation_step; via out send "\n\n"; //end test unobservable; } value Communicating is abstraction () { Decoded_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]] ]; Encoded_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; Read_Write : Connection[sequence[view[name : String, val : String]]]; Request : Connection[view[agent_id : String, foci : sequence[view[focus_name : String, focus_params : sequence[String]]]]]; Update : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; decoded_message_data : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]; encoded_message_data : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]; knowledge_items : sequence[view[name : String, val : String]]; perceived_knowledge_items : sequence[view[name : String, val : String]]; updated_knowledge_items : sequence[view[name : String, val : String]]; perception_request : view[agent_id : String, foci : sequence[view[focus_name : String, focus_params : sequence[String]]]]; //start test encoded_message_data = view(ID : 78, protocol : "question_answer", sender : "Zawar", receiver : "Danny", performative : "ping", content : sequence(view(key : "Location", val : "KULeuven"))); perceived_knowledge_items = sequence(view(name : "Location", val : "KULeuven")); updated_knowledge_items = sequence(view(name : "Location", val : "Valoria"), view(name : "Location", val : "KULeuven")); perception_request = view(agent_id : "my_agent_id", foci : sequence(view(focus_name : "Location", focus_params : sequence("Network")))); //conversation_step : // view(78 : Integer, protocol : "question_answer", // sender : "Zawar", receiver : "Danny", performative : "ping", // content : sequence(view(key : "Location", val : "KULeuven"))); //end test via Decoded_Message receive decoded_message_data; unobservable; //start test via out send "In Communicating (in): "; via out send "decoded message data: "; via out send decoded_message_data; via out send "\n\n"; via out send "Conversations updating..."; //end test via Update send decoded_message_data; unobservable; //start test //via out send "Conversations updated!"; //via out send "\n\n"; //end test via Read_Write receive knowledge_items; unobservable; //start test via out send "data received from knowledge repository: "; via out send knowledge_items; via out send "\n\n"; //end test via Request send perception_request; unobservable; via Encoded_Message send encoded_message_data; unobservable; //start test via out send "In Communicating (out): "; via out send encoded_message_data; via out send "\n\n"; //end test code via Update send encoded_message_data; unobservable; } value MessageEncoding is abstraction() { Encoded_Message : Connection[view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]]; Add_Out : Connection[view[ID : Integer, sender : String, receiver : String, performative : String, content : String]]; encoded_message_data : view[ID : Integer, protocol : String, sender : String, receiver : String, performative : String, content : sequence[view[key : String, val : String]]]; message_out : view[ID : Integer, sender : String, receiver : String, performative : String, content : String]; via Encoded_Message receive encoded_message_data; //start test via out send "In MessageEncoding (in): "; via out send encoded_message_data; via out send "\n\n"; via out send "Fin"; //end test unobservable; via Add_Out send message_out; }