hdolder.com srl  

Software R&D
 

   hdc Home    |    Content    |    Blog    |    Director    |    Contact    |    mail us   

 

M&P  in Simulations

MPDES: Discrete Events Simulator

Posted on April 14, 2015 by Herman E. Dolder

This is a draft of a forthcoming article. Its purpose is to provide some information to current MPDES betatesters.
 

Introduction

MPDES is a Discrete Events Simulator integrated in the M&P platform [1] .

The design of MPDES was inspired by the GPSS [2] (GENERAL PURPOSE SIMULATION SYSTEM) and provides a similar functionality, but since MPDES is developed and integrated with M&P it presents a series of advantages:

  • Models are expressed in XML and are instantiable by BXaml
  • Reports have XML format
  • The system is extensible, it is possible to create custom blocks.
  • The Blocks-inside-Blocks facility of M&P allows the creation of "macro" blocks.
  • The architecture is modular and object oriented.
  • The system provides Scripting by using M&P BScript.

The full integration with M&P allows access to files and databases, access to internet and distributed processing.

Concepts and Facilities

M&P has an "event-driven dataflow" architecture [1] ideal for implementing discrete events simulators. MPDES uses all the concepts and facilities available in M&P.

MPDES Block Types and Parameters

BLOCK TYPE INPUT PARAMETERS
DFacility int capacity
string id
BSX targets
BSX timer
DGenerator string id
int maxCount
BSX targets
BSX timer
DQueue string id
BSX targets
DSimulator string id
DStorage int capacity
string id
BSX targets
DTerminator string id
DTEST BSQ condition
string id
BSX targets1
BSX targets2
DTRANSFER string id
double rela
BSX targets1
BSX targets2
   

Random distributions implemented

DISTRIBUTION BSX Expression
exponential (exponential   <mean>)
uniform (uniform  <mean>  <halfrange>)
   

Random distributions to be implemented

DISTRIBUTION BSX Expression
gamma (gamma  <alpha>  <beta>)
normal (normal  <mu>  <sigma>)
pareto (pareto  <alpha>)
triangular (triangular  <lower>  <upper>  <mode>)
weibull (weibull  <alpha>  <beta>)
   

Symbols used in statistics and Reporting

SYMBOL TITLE in Reports
EC Entries
ZTEC ZeroResidence
CUROC CurrContent
IDLE Idle
AVGRT AvgResidence
MAXRT MaxResidence
MINRT MinResidence
AVGOC AvgContent
MAXOC MaxContent
MINOC MinContent
   

GPSS functionality implemented in MPDES

ADVANCE DEPART ENTER GENERATE LEAVE QUEUE RELEASE SEIZE STORAGE TERMINATE TEST TRANSFER

 

Example

The following MPDES "CARREPAIR" model includes DQueue, DFacility and DStorage blocks and has to do with cars arriving for minor service at a repair shop that has three service bays. The arrival rate is a car every 100 ± 23 seconds.

The cars are all first inspected by a single inspector who takes 50 ± 6 seconds to inspect the cars.

The minor repairs are done in only 25 ± 7 seconds.

 <mpXaml
  xmlns='desx'  
  xmlns:blk='blkx'  
  >
   <Simulator01
    id='*SIM1'  
    >
     <GenerateCustomers
      id='CARS'  
      timer='(uniform 100 23)'
      maxCount='50'  
      targets='(QUE1)'  
      />
     <DQueue
      id='QUE1'  
      targets='(INSPECTOR)'  
      />
     <DFacility
      id='INSPECTOR'  
      capacity='1'
      timer='(uniform 50 6)'
      targets='(BAYS)'  
      />
     <DStorage
      id='BAYS'
      capacity='3'
      targets='(REPAIR)'
      />
     <DFacility
      id='REPAIR'  
      timer='(uniform 25 7)'
      targets='(QUE2)'  
      />   
     <DQueue
      id='QUE2'  
      targets='(BILL)'  
      />
     <DFacility
      id='BILL'  
      timer='(uniform 25 7)'
      targets='(TERM1)'  
      />
     <DTerminator
      id='TERM1'  
      />
   </Simulator01>
</mpXaml>
 

The simulation output report in XML is

<REPORT         ModelFile="C:\,,,\MPDES\MODELS\CARREPAIR.xml"
   DateTime="2015-04-15T19:51:37"
   >
 <Simulator01
   id="SIM1"
   />
 <GenerateCustomers
   id="CARS"
   maxCount="50"
   />
 <DQueue
   id="QUE1"
   Entries="50"
   ZeroResidence="50"
   CurrContent="0"
   Idle="1"
   AvgResidence="0"
   MaxResidence="0"
   MinResidence="2147483647"
   AvgContent="1"
   MaxContent="1"
   MinContent="1"
   />
 <DFacility
   id="INSPECTOR"
   capacity="1"
   Entries="50"
   AvgResidence="49.96"
   CurrContent="0"
   Idle="0.49"
   MaxResidence="56"
   MinResidence="44"
   AvgContent="1"
   MaxContent="1"
   MinContent="1"
   />
 <DStorage
   id="BAYS"
   capacity="3"
   Entries="50"
   ZeroResidence="50"
   CurrContent="0"
   Idle="1"
   AvgResidence="0"
   MaxResidence="0"
   MinResidence="2147483647"
   AvgContent="1"
   MaxContent="1"
   MinContent="1"
   />
 <DFacility
   id="REPAIR"
   capacity="1"
   Entries="50"
   AvgResidence="25.94"
   CurrContent="0"
   Idle="0.74"
   MaxResidence="32"
   MinResidence="18"
   AvgContent="1"
   MaxContent="1"
   MinContent="1"
   />
 <DQueue
   id="QUE2"
   Entries="50"
   ZeroResidence="50"
   CurrContent="0"
   Idle="1"
   AvgResidence="0"
   MaxResidence="0"
   MinResidence="2147483647"
   AvgContent="1"
   MaxContent="1"
   MinContent="1"
   />
 <DFacility
   id="BILL"
   capacity="1"
   Entries="50"
   AvgResidence="25.94"
   CurrContent="0"
   Idle="0.74"
   MaxResidence="32"
   MinResidence="18"
   AvgContent="1"
   MaxContent="1"
   MinContent="1"
   />
 <DTerminator
   id="TERM1"
   Entries="50"
   />
</REPORT>

See also

References

  1. M&P H5J Concepts and Facilities
  2. GPSS World Reference Manual

Related Links


 

 

 

TBW The BLOCKS World ©2015  hdolder.com srl
C50417_DES
2015-06-26