Skip to content

Commit 5fdec36

Browse files
committed
Update docs
1 parent f12ad77 commit 5fdec36

File tree

1 file changed

+43
-16
lines changed

1 file changed

+43
-16
lines changed

docs/README.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
The documentation covers the following aspects:
44

5-
[TOC]
5+
* [Introduction](#introduction)
6+
* [Modeling](#modeling)
7+
+ [Processes](#processes)
8+
+ [Resources](#resources)
9+
+ [Putting it together](#putting-it-together)
10+
* [Monitoring](#monitoring)
11+
+ [Reports](#reports)
12+
613

714
## Introduction
815

@@ -77,41 +84,59 @@ In any case, it is simple to extend the standard resources given that the code i
7784

7885
### Putting it together
7986

80-
Processes that interact with common resources may create highly dynamic behavior which may not be analytically tractable and thus has to be simulated.
87+
Processes that interact with common resources may create highly dynamic behavior which may not be analytically tractable and thus have to be simulated. Sim# includes a number of samples that, while being easy to understand and simple, show how to model certain processes such as preemption, interruption, handover of resource requests and more. A short summary of the provided samples together with the highlights are given in the following:
88+
89+
##### [BankRenege](../src/Samples/BankRenege.cs)
90+
91+
- Timeout when waiting for a resource
92+
- Track and print statistics
93+
94+
The bank renege sample uses a single shared resource (bank teller) that customers queue for. There is a single queue and each customer has a certain patience for waiting in the queue. When the patience has run out, the customer will leave the queue without doing business. The queue is not explicitly added to the model, but is part of the Resource that models the bank teller. This resource can automatically track statistics on the queue's length and waiting time.
8195

82-
It is best to look at the many samples that have been provided along with the Sim# sources to see both simple and more complex models. Here is a short summary:
96+
##### [GasStationRefueling](../src/Samples/GasStationRefueling.cs)
8397

84-
* [BankRenege](../src/Samples/BankRenege.cs)
98+
- Combination of discrete (fuel pump) and continuous resource (tank)
99+
- Use of *When*-events to react to resupply of the tank
85100

86-
This sample uses a single shared resource (bank teller) that customers queue for. The model shows how quitting a queue prematurely is possible, for instance because the customer has run out of patience. It also tracks and prints several statistics.
101+
The gas station refueling sample uses both a discrete (fuel pump) and a continuous (tank) resource. Cars are queuing at the fuel pump and consume gasoline from the tank. When the tank runs below a certain threshold a truck is dispatched to refill it. *When*-events of resources were introduced as part of the Sim# 3.1 release (they are ported from the [desmod](https://desmod.readthedocs.io/en/latest/) package - an extension of SimPy). Note that the Sim# is a discrete event simulation kernel, thus there cannot be a continuous drain from the tank.
87102

88-
* [GasStationRefueling](../src/Samples/GasStationRefueling.cs)
103+
##### [KanbanControl](../src/Samples/KanbanControl.cs)
89104

90-
This sample uses both a discrete (fuel pump) and a continuous (tank) resource. Cars are queuing at the fuel pump and consume gasoline from the tank. When the tank runs below a certain threshold a truck is dispatched to refill it. This shows how *When*-events of resources can be used. These events have been introduced with Sim# 3.1 (they are ported from the [desmod](https://desmod.readthedocs.io/en/latest/) package - an extension of SimPy).
105+
- Usage of Monitors to track variables in user code
91106

92-
* [KanbanControl](../src/Samples/KanbanControl.cs)
107+
The kanban control sample shows how a simple production system that uses kanban can be modeled. It shows how to use monitors to track a variable of interest (the number of kanbans in stock over time).
93108

94-
This samples shows how a simple production system that uses kanban can be modeled. It shows how to use monitors to track a variable of interest (the number of kanbans in stock over time).
109+
##### [MachineShop](../src/Samples/MachineShop.cs) and [MachineShopSpecialist](../src/Samples/MachineShopSpecialist.cs)
95110

96-
* [MachineShop](../src/Samples/MachineShop.cs) and [MachineShopSpecialist](../src/Samples/MachineShopSpecialist.cs)
111+
- Interrupting other processes
112+
- Usage of PreemptivePriorityResource and ResourcePool
97113

98-
In this model a production system with machine break-downs is described. It shows how to interrupt processes, e.g. in the case of a break-down the current job is suspended. The -Specialist model additionally shows how to use the ResourcePool to model repairman with different characteristics.
114+
In this model a production system with machine break-downs is described. In the event of a break-down the current job is interrupted and suspended until a repairman has been dispatched to fix it. The -Specialist model additionally shows how to use the ResourcePool to model repairman with different characteristics.
99115

100-
* [MM1Queueing](../src/Samples/MM1Queueing.cs)
116+
##### [MM1Queueing](../src/Samples/MM1Queueing.cs)
117+
118+
- Comparison of analytic with simulated results
119+
- Tracking of statistics
120+
- Reports
101121

102122
The "Hello World" of simulation models. It shows how to perform repetitions and track statistical properties. It also prints the analytical properties of this system - which are known in this case.
103123

104-
* [ProcessCommunication](../src/Samples/ProcessCommunication.cs)
124+
##### [ProcessCommunication](../src/Samples/ProcessCommunication.cs)
125+
126+
- Interaction between processes
127+
- Store resource
105128

106129
This model describes a simple producer-consumer situation. It shows how processes may interact with each other using a Store resource.
107130

108-
* [SimpleShop](../src/Samples/SimpleShop.cs) and [SteelFactory](../src/Samples/SteelFactory.cs)
131+
##### [SimpleShop](../src/Samples/SimpleShop.cs) and [SteelFactory](../src/Samples/SteelFactory.cs)
132+
133+
* Acquiring and releasing a resource in separate processes
109134

110135
These model describe a two-step production. The first step may be blocked by the second. The models should show how one process may obtain a resource, but another processes releases that resource.
111136

112137
## Monitoring
113138

114-
Monitoring is new with Sim# 3.2. Instead of following the SimPy approach which is difficult to translate to .NET. The implementation in Sim# is more akin to [Salabim](https://www.salabim.org).
139+
Monitoring has been introduced with Sim# 3.2. Instead of following the SimPy approach which is difficult to translate to .NET. The implementation in Sim# is more akin to [Salabim](https://www.salabim.org).
115140

116141
There are two different kinds of monitors:
117142

@@ -128,7 +153,9 @@ var server = new Resource(env, capacity: 5) {
128153
};
129154
```
130155

131-
Monitors may be created with ```collect: true```. This means the monitor will keep the datapoints and thus can compute median, percentiles, and print a histogram of the data. By default collect is false, which still allows computing min, max, mean, standard deviation, count, and sum in a memory efficient way.
156+
Monitors may be created with ```collect: true```. This means the monitor will keep the datapoints and thus can compute median, percentiles, and print a histogram of the data. By default collect is false, which still allows computing min, max, mean, standard deviation, count, and sum and in a memory efficient way.
157+
158+
As has been mentioned above, the KanbanControl sample shows how to use monitors in the code that describes the model in order to track own variables of interest.
132159

133160
### Reports
134161

0 commit comments

Comments
 (0)