modelBookBuyerAgent

Extends from BaseClasses.PartialAgent.

Information

Overview

  • This model is a an agent that tries to buy a pre-set book from one or more BookSellerAgents.
  • It is based on communication via UDP and logic implemented with the help of the StateGraph Modelica library.
  • It is used together with at least one BookSellerAgent.

Concept

The BookBuyerAgent calls for proposals from all known BookSellerAgents to buy a book, which is set before simulation. The agent then compares all offers from the seller agent and choses the book with the lowest price. Afterwards the book is bought from the seller agent. The logic is implemented with the help of the StateGraph library. Communication is realized with the help of the DeviceDriver library and follows the language standards for multi-agent-systems set by the FIPA to the highest possible extend for Modelica models. The presented agent has the purpose of demonstrating the possibility of agent implementation in Modelica by implementing the behaviour of the BookBuyer agent presented in Caire, 2009, JADE PROGRAMMING FOR BEGINNERS.

References

  • Felix Bünning. Development of a Modelica-library for agent-based control of HVAC systems. Bachelor thesis, 2016, RWTH Aachen University, Aachen, Germany.
  • FIPA ACL Message Structure Specification
  • FIPA Communicative Act Library Specification
  • Caire, 2009, JADE PROGRAMMING FOR BEGINNERS

Example Results

Parameters

TypeNameDefaultDescription
Integername (from PartialAgent)Name of the agent (five-digit number, eg. 10001)
BooleanusePoke (from PartialAgent)falseUse Modelica internal communication for inbox update
RealsampleRate (from PartialAgent)5Sample time for inbox update (used if usePoke=false)
RealknownSellers[30001; 30002; 30003]List of known BookSellerAgents (their adresses)
RealISBN3551551677.0ISBN number of the book that the agent tries to buy
IntegersampleTime20Period of time between two tries of the agent to buy the book

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.BooleanOutputsendOut (from PartialAgent)Turns true when the sending unit of the agent is active
Modelica.Blocks.Interfaces.BooleanOutputbookBoughtIndicator that turns true if a book was succesfully bought

Components

TypeNameDefaultDescription
HVACAgentBasedControl.Agents.MessageNotificationmessageNotification (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packagerpackager (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddRealcontent (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetRealget_content (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Communication.UDPReceiveuDPReceive_adapted (from PartialAgent)
UDPSend_adapteduDPSend_adapted (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegersender (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegerreceiver (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegerreply_to (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddRealontology (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetperformative (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetsender (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetreceiver (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetreply_to (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetRealgetontology (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegerperformative (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetIntegergetMessageID (from PartialAgent)
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddIntegermessageID (from PartialAgent)
Modelica.StateGraph.StateGraphRootstateGraphRoot (from PartialAgent)
SendSamplesendSample (from PartialAgent)
Realproposals
Integercounter
IntegercounterProposals
BooleanrequestsDone
ReallowestPrice
BooleanbookOffered
Modelica.StateGraph.InitialStepwaiting
Modelica.StateGraph.StepcomposeRequest
Modelica.StateGraph.StepcollectProposal
Modelica.StateGraph.StepcomposeBuy
Modelica.Blocks.Math.IntegerChangeintegerChange
Modelica.Blocks.Sources.SampleTriggersampleTrigger
Modelica.StateGraph.TransitionWithSignaltransitionWithSignal
Modelica.StateGraph.Transitiontransition
Modelica.StateGraph.Stepcheck
Modelica.StateGraph.TransitionWithSignalnewMessage
Modelica.StateGraph.TransitionWithSignaloffer
Modelica.StateGraph.TransitionWithSignalrefuse
Modelica.StateGraph.TransitionWithSignaldone
Modelica.StateGraph.TransitionWithSignalnotDone
Modelica.StateGraph.StepWithSignalsendRequest
Modelica.StateGraph.StepWithSignalsendBuy
Modelica.StateGraph.Stepcheck1
Modelica.StateGraph.TransitionWithSignalconfirmation
Modelica.StateGraph.StepsetDone
Modelica.StateGraph.Transitiontransition1
Modelica.StateGraph.Transitiontransition3
Modelica.StateGraph.TransitionWithSignalnewMessage1
Modelica.Blocks.Logical.Oror1
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression1
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression2
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression3
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression4
Modelica.StateGraph.Transitionabort
Modelica.StateGraph.StepstateOfOffers
Modelica.StateGraph.TransitionWithSignaltransitionWithSignal1
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression5
Modelica.StateGraph.TransitionnoOffers
Modelica.StateGraph.TransitionabortAction
Modelica.StateGraph.TransitionabortAction1
Modelica.StateGraph.StepnotServed
Modelica.StateGraph.Transitiontransition2
Modelica.Blocks.Logical.Andand1
Modelica.Blocks.Sources.BooleanExpressionbooleanExpression6

Revisions

  • October 2015, by Felix Bünning: Developed and implemented