SimSharp icon indicating copy to clipboard operation
SimSharp copied to clipboard

Implement a standard library for modeling processes

Open abeham opened this issue 7 years ago • 2 comments

Many processes can be standardized and a library of atomic processes can be created. In process models one creates a set of agents or entities and models their flow through a network of processes. The network features several streams. Each stream starts at "Create" and ends at "Finalize". Multiple streams may synchronized, they may be created also a result of one stream through "Clone" or merged to one stream using "Merge".

  1. Create - creates new entities (0:1)
  2. Finalize - finalizes the entities (1:0)
  3. Queue - puts entities into a queue (1:1)
  4. Delay - delays entities for some time (1:1)
  5. Attach - request resources and attach them (1:1)
  6. Detach - free resource requests and detach them (1:1)
  7. Collect - combine multiple entities into one collection entity (1:1)
  8. Dispense - dispenses the collection entity (1:1)
  9. Clone - creates one or multiple copies of an entity (1:n)
  10. Merge - creates a new entity based on a number (n:1)
  11. Distribute - select the next process based on some strategies (round-robin, custom) (1:1)
  12. Sync - uses n streams of entities and synchronizes them (n:n)

Collect and dispense are 1:1 because entity collection would also be a sub-type of entity. The resources in Sim# are not subclasses of one common class. Some abstraction must be created that hides the used resource type.

The processes should feature event handlers such as OnEnter, OnExit to allow collecting statistics or perform other manipulation to the entity instance.

abeham avatar Sep 24 '18 03:09 abeham

There is a DES library for the R language, called simmer, based around this very concept. They call the streams that entities flow through 'trajectories' and there is a nice paper about it that you be interested in reading.

sean-reed avatar May 19 '22 11:05 sean-reed

@sean-reed, thanks that looks interesting.

abeham avatar May 19 '22 11:05 abeham