Skip to content
Davide Conzon edited this page Mar 17, 2020 · 35 revisions

This project provides a serial of APIs used for the interaction of three main components (Simulation and Optimization Orchestrator, Optimization Tool and Simulation Manager) based on parameter optimization in the distributed architecture of the Simulation and Optimization Environment in the CPSWarm project.

All of these APIs are used to transfer messages between the components by integrating an XMPP client to connect with each other through the XMPP server to control the optimization progress, automatically publish their own presence status and backup the optimization status for optimization recovery. They can be divided into three main groups based on their functionalities.

  1. eu.cpswarm.optimization.messages
API Description Components involved Type of communication Data included
Message Descritpion Text text text Text message. Fields:
  • One
  • Two
  • Three
  1. eu.cpswarm.optimization.statuses
API Description Components involved Type of communication Data included
OptimizationStatusType Emulation of the possible status of the optimization process. It’s a field of the OptimizationStatus API, but also a field of OptimizationTaskStatus API Sent by a OT to the SOO through the OptimizationStatus message, or published by OT through its available presence when optimization status is changed Text message. Emulation:
  • None: unknown optimization process.
  • Started: Optimization is started, reply to the StartOptimization message
  • Running: Optimization is running.
  • ErrorOptimizationFaild: Optimization is failed in OT side due to unknown error
  • Cancelled: Optimization is cancelled by request from SOO
  • Complete: Optimization is completed successfully
OptimizationToolStatus Used by OT to publish its Available presence together with its status(the serialized json string of this class instance) in case one running optimization status is changed Published by the OT. It can be received by all components Text message. Fields:
  • tasks: a list of OptimizationTaskStatus messages. It means one OT instance can manage multiple optimization processes at same time
  • Type: The type of the message (fixed value: OptimizationTool). It indicates that the publisher of the presence.
OptimizationTaskStatus Used by OT to record the info of each optimization process Generated and integrated as a field in the OptimizationToolStatus by OT when publishing the OT presence status. Text message. Fields:
  • OID: the ID of a specific optimization process
  • StatusType: The status of current optimization process, its value is one of the emulation in the OptimizationStatusType API
  • BestFitness: The best fitness value in current generation for the optimization.
  • Generation: which generation the optimization is running in.
  • MaxGeneration: The maximum generation to be finished by the optimization.
SOOStatus Used by SOO to publish its Available presence together with its status (the serialized json string of this class instance) to indicate the current optimization info Published by the SOO. It can be received by all components Text message. Fields:
  • TaskId: the ID of current optimization process managed by SOO
  • SCID: the simulation configuration ID hold by all available SMs used by current optimization
  • Type: The type of the message (fixed value: SOO). It indicates that the publisher of the resence.
SimulationManagerCapability Used by SM to specify its capabilities, this info will be used by SOO to select the available SMs for the optimization. Generated and integrated as a field in the SimulationManagerStatus message by SM. Text message. Fields:
  • Dimensions: the supported dimension of the simulator, possible values: any, 2D, 3D
  • MaxAgents: The maximum number of agents that the SM can support
SimulationManagerStatus Used by the SM to publish its Available presence together with its status (the serialized json string of this class instance) to indicate its capability used by SOO when it starts up and if it’s configured which is useful for OT to recognize available SM. Published by the SM, received by all components. Text message. Fields:
  • SCID: the simulation configuration ID of the SM received during the file transfer process from SOO. It’s used by OT to filter all SMs for optimization process.
  • Type: The type of the message (fixed value: SimulationManager). It indicates that the publisher of the presence
  • SID: ID of the simulation, assigned by the OT, and default is 1 when it’s sent by SOO.
  • Capability: the capabilities of the SM
SimulationResult Returns the result of a simulation performed for optimization. Sent by a SM to the OT during optimization. Text message. Fields:
  • OID: The ID of the optimizationprocess.
  • Type: The type of the message (fixed value: SimulationResult).
  • SID: ID of the single simulation.
  • FitnessValue: The fitness of the controller, calculated by the fitness function.
  • Success: Boolean value.
  1. eu.cpswarm.optimization.parameters
API Description Components involved Type of communication Data included
Message Descritpion Text text text Text message. Fields:
  • One
  • Two
  • Three
  1. eu.cpswarm.optimization.messages parameter optimization API1
  2. eu.cpswarm.optimization.statuses parameter optimization API2
  3. eu.cpswarm.optimization.parameters
Clone this wiki locally