User Tools

Site Tools


sajas

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sajas [2016/03/11 15:19]
hlc [SAJaS]
sajas [2020/12/02 13:16] (current)
hlc [MASSim2Dev]
Line 11: Line 11:
 SAJaS provides, for certain kinds of applications, increased simulation performance, as compared to JADE. SAJaS provides, for certain kinds of applications, increased simulation performance, as compared to JADE.
  
-A MAS Simulation to Development (**MASSim2Dev**) tool is SAJaS companion, and allows automatic conversion of a SAJaS-based simulation into a JADE MAS, and vice-versa.+A MAS Simulation to Development (**[[MASSim2Dev|MASSim2Dev]]**) tool is SAJaS companion, and allows automatic conversion of a SAJaS-based simulation into a JADE MAS, and vice-versa.
  
  
Line 43: Line 43:
 ==== MASSim2Dev ==== ==== MASSim2Dev ====
  
-The same JADE-based implementation can be used to run the MAS in JADE or its equivalent simulation in SAJaS. Minor changes are required, related with redirecting class imports from JADE to SAJaS or vice-versa.+The same JADE-based implementation can be used to run the MAS in JADE or its equivalent simulation in SAJaS. Minor changes are required, related with [[JADE_SAJaS_dict|redirecting class imports]] from JADE to SAJaS or vice-versa.
  
 The [[MASSim2Dev|MASSim2Dev]] tool performs the needed changes automatically. The [[MASSim2Dev|MASSim2Dev]] tool performs the needed changes automatically.
 +
 +An additional change to take into account is that although the import of the ''jade.core.AID'' class should not, in general, be redirected to ''sajas.core.AID'', any direct instantiation of ''AID'' should be made in the SAJaS' version of this class (which extends JADE's one). Example:
 +
 +<code>
 +import sajas.core.Agent;
 +import jade.core.AID;
 +
 +...
 +
 +ACLMessage m = new ACLMessage(ACLMessage.REQUEST);
 +m.addReceiver(new sajas.core.AID(name, false);
 +...
 +
 +</code>
  
  
Line 69: Line 83:
   * {{:sajas_repast3_vis_test.zip|source code in SAJaS+Repast3 extended with visualization features}}   * {{:sajas_repast3_vis_test.zip|source code in SAJaS+Repast3 extended with visualization features}}
   * {{:sajas_repasts_test.zip|source code in SAJaS+RepastS}}   * {{:sajas_repasts_test.zip|source code in SAJaS+RepastS}}
 +  * {{:sajas_repasts_vis_test.zip|source code in SAJaS+RepastS extended with visualization features (full Eclipse project)}}
  
 The classes that are used to run the different MAS/simulation infrastructures are ''JadeServiceConsumerProviderLauncher.java'', ''Repast3ServiceConsumerProviderLauncher.java'' and ''RepastSServiceConsumerProviderLauncher.java'', respectively. The classes that are used to run the different MAS/simulation infrastructures are ''JadeServiceConsumerProviderLauncher.java'', ''Repast3ServiceConsumerProviderLauncher.java'' and ''RepastSServiceConsumerProviderLauncher.java'', respectively.
Line 111: Line 126:
  
 An example of this use is included in the source code for the [[sajas#benchmark_scenario|benchmark scenario]] above. An example of this use is included in the source code for the [[sajas#benchmark_scenario|benchmark scenario]] above.
- 
  
 === Repast Simphony === === Repast Simphony ===
Line 129: Line 143:
  }  }
 </code> </code>
 +
 +
 ==== Current limitations ==== ==== Current limitations ====
  
-SAJaS takes a near-full advantage of JADE's features. The following are a couple of exceptions regarding the current version of SAJaS+SAJaS takes a near-full advantage of JADE's features. However, beware of the following issues
-  * //Handling time//: The FIPA ACL message structure specification includes an optional //reply-by// parameter, which may be used to halt waiting for the next sequential message in an interaction protocol when the indicated time has elapsedGiven the simulation bias of SAJaS, it is not clear yet to which time this should refer to. Translating such timestamps to simulation ticks is probably the way to gobut enough simulation ticks should be allowed for responding agents to process the message and respond accordingly, which requires having a mechanism that interfaces properly with simulation scheduling. \\ For the same reason, two specific JADE behaviours that rely on system time should also be avoided: ''WakerBehaviour'', which specifies a task to be executed after a specific amount of time has elapsed, and ''TickerBehaviour'', which specifies a periodic task to be executed in regular time intervals.+  * //Handling time//: The current version of SAJaS includes support for timer-based functionality as available in JADE agents, which supports features such as ''TickerBehaviour''s, ''WakerBehaviour''s and the handling of the optional //reply-by// parameter in ACL messages that are used in specific FIPA interaction protocols. However, the usage of these features in SAJaS should be carefully considered and is not encouragedIn fact, given the simulation bias of SAJaS, using milliseconds for specifying timers may have a significant impact on simulation performance. Translating timestamps to simulation ticks is not straightforwardas it depends on the scenario at hands.
   * //Blocking approaches//: JADE includes a few blocking approaches for agent interaction, namely based on the ''blockingReceive'' and ''doFipaRequestClient'' methods in the ''Agent'' class. These methods block agent execution until a matching message is received or a complete protocol is concluded. Given the single-threaded approach of SAJaS, or more precisely of the simulation frameworks (such as Repast) it may be aligned with, blocking approaches do not work. \\ Another typical usage of blocking approaches in JADE concerns (de)registering and searching the DF (JADE's yellow page service), for which a number of blocking methods are available in the ''DFService'' class. Given their quite common usage, these methods are still available in SAJaS, where they have been reimplemented so that they do not block, while achieving the desired functionality.   * //Blocking approaches//: JADE includes a few blocking approaches for agent interaction, namely based on the ''blockingReceive'' and ''doFipaRequestClient'' methods in the ''Agent'' class. These methods block agent execution until a matching message is received or a complete protocol is concluded. Given the single-threaded approach of SAJaS, or more precisely of the simulation frameworks (such as Repast) it may be aligned with, blocking approaches do not work. \\ Another typical usage of blocking approaches in JADE concerns (de)registering and searching the DF (JADE's yellow page service), for which a number of blocking methods are available in the ''DFService'' class. Given their quite common usage, these methods are still available in SAJaS, where they have been reimplemented so that they do not block, while achieving the desired functionality.
 +  * //ServiceHelper features//: JADE features that rely on service helpers, such as topic-based communication, are not currently supported by SAJaS, due to their added complexity.
 +  * //AMS/DF services//: Although the most typical usages of the DF service (register/deregister/search) are covered in SAJaS, some are not, including modifying a DF registration and searching the AMS (which is seldom useful).
 +  * //Mobility between containers//: Mobility-related methods are not supported yet, because SAJaS simplifies the usage of containers.
  
  
Line 151: Line 170:
 This page has been created and is maintained by [[start|Henrique Lopes Cardoso]]. Any feedback or questions are highly appreciated. This page has been created and is maintained by [[start|Henrique Lopes Cardoso]]. Any feedback or questions are highly appreciated.
  
-//[[hlc@fe.up.pt|Henrique Lopes Cardoso]] 2016/03/04 11:00//+ --- //[[hlc@fe.up.pt|Henrique Lopes Cardoso]] 2016/10/21 16:32//
sajas.1457709553.txt.gz · Last modified: 2016/03/11 15:19 by hlc