## 3 E-barter Case Study
### System Analysis and Design with SEA_ML
#### 3.1.2. MAS Design by Modeling in SEA_ML  
In accordance with the SEA_ML-based MDD methodology, we start by creating system models based on different viewpoints. The information needed for designing these models is gathered with the appropriate requirements engineering within the domain of the E-barter System. In this study, we present three viewpoints of the E-barter system in SEA_ML namely MAS, Agent Internal and AgentSWS interaction viewpoints which represent both the MAS and SWS aspect of the system. The diagrams representing the models in these viewpoints are shown in Figures 2-4 respectively. An agent's general interaction and bartering processes are modeled with using SEA_ML based on the performed analysis discussed above. In this step, we evaluate the SWA agent instances in the MAS and then model the internal structure of each agent using Agent Internal Viewpoint. It is worth noting that, the instance models and the instances of specific elements (such as SWA) are related to example models conforming to the SEA_ML meta-model within the model-driven approach. After  
Figure 2: Overview of E-Barter MAS. that, we model the interactions of these agents with services, using the internal components of the semantic web services of Agent-SWS interaction viewpoint. According to the system analysis realized in the previous phases (discussed in Section 3.1.1), the system constitutes of two semantic web organizations: Management and Customers. Each semantic web organization is a composition of SWAs having similar goals or duties. These organizations need access to some resources in the EBarterSystem environment. For this reason, there are interactions with the EBarterSystem environment to get access permission. In addition, the interactions of agents with each other are modeled. In this case, study, the MAS-to-be-implemented consists of 3 types of semantic web agents: Matchmaker, Customer and ServiceAgent. All Customers and ServiceAgents cooperate with Matchmaker to access the E-Barter system. In addition, customer agents interact with each other to negotiate for bartering. For instance, a Customer agent cooperates with a Matchmaker agent to get the list of Customer agents who have the requested product(s). When the system's agents are determined in MAS viewpoint, the internal structure of each semantic web agent is modelled. The instance model should cover all the required roles, behaviors, plans, beliefs, and goals of an agent. Figure 3, illustrates an instance model of the agent internal viewpoint for a Customer agent. Figure 3: Agent Internal Diagram. Customer agent has two Capabilities called SearchCapability and BarteringCapability. The SearchCapability includes its Goals (\"ServiceMatching\" and \"AgentRegistration\"), Belief (\"barter_goods\"), and Plans (\"AskMatchmaker\" and \"HandleMatch\"). The BarteringCapability includes its own Goal (\"AggrementNegotiation\"), Belief (\"barter_goods\"), and Plans (\"PerformNegotiation\", \"ProposalEval\" and \"NegatiationFinalize\"). When considering the Beliefs, the agent uses them to know which goods it has, and which goods it needs. Therefore, the agent decides what to offer and what to require for in the bartering process. Also, the agent could play Searching and Bartering roles. The Searching role could realize its task over \"Finding Services\" behavior by calling the AskMatchmaker plan. If this plan is executed successfully, \"Getting Agent Names from Services\" behavior is performed with the \"HandleMatch\" plan. Otherwise, the agent performs \"Sending Register Request to Matchmaker\" behavior. The Bartering role realizes all behaviors associated with the bartering transaction. The bartering transaction is carried out among the Customer agents and the \"Bartering Role\" covers all these process behaviors which are realized by relevant plans. Figure 4 shows the instance model which includes semantic services and the required plan instances of the Agent-SWS interaction viewpoint.