Skip to content

Commit ee93d84

Browse files
committedFeb 18, 2022
Update
1 parent 8f72243 commit ee93d84

File tree

9 files changed

+1510
-1510
lines changed

9 files changed

+1510
-1510
lines changed
 

‎.gitignore

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# Compiled class file
2-
*.class
3-
4-
# Log file
5-
*.log
6-
7-
# BlueJ files
8-
*.ctxt
9-
10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
12-
13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23+
hs_err_pid*

‎LICENSE

+201-201
Large diffs are not rendered by default.

‎README.md

+110-110
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,110 @@
1-
# Introduction
2-
The purpose of this library is to provide a method for evaluating both transient and steady-state M/M/C/K single queues and queueing networks. The library has been designed to make this process as smooth as possible by restricting the input to the adjacency matrix and the basic parameters that characterize the system.
3-
4-
Using the library involves the following two steps:
5-
6-
**Step 1:** Construct the infinitesimal generator for the network at hand. This is handled automatically by the `create` class.
7-
8-
**Step 2:** Use the object created in the aforementioned step to retrieve the behavior of the network. This is handled by the `evaluate` class.
9-
10-
# Basic Overview
11-
12-
## Files
13-
14-
- `mc_math-1.2.jar`: The library file.
15-
16-
## Classes
17-
18-
- `create`: Automatically constructs the infinitesimal generator (the transition rate matrix) and various other parameters.
19-
20-
- `evaluate`: Uses an object defined with `create` to evaluate the queueing network.
21-
22-
# Getting Started
23-
Firstly, download and add `mc_math.jar` to your Java-project.
24-
25-
Now import the `queueing` classes.
26-
27-
```java
28-
import queueing.*;
29-
```
30-
31-
Define the weighted directed adjacency matrix using the structure: (1) Sources nodes, (2) queueing nodes, and (3) sink node. In this example, we have three queueing nodes. A single source node feeds all arriving customers into the first queueing node. The flow then splits into three parts sending 45% of the customers to queue 2, 30% to queue 3, and 25% to the sink node. Queue 2 and 3 send all customers to the sink after their service has been completed.
32-
33-
```java
34-
double[][] A = {{0,1,0,0,0},
35-
{0,0,0.45,0.30,0.25},
36-
{0,0,0,0,1},
37-
{0,0,0,0,1},
38-
{0,0,0,0,0}};
39-
```
40-
41-
Define the remaining characteristics of the system, i.e. the arrival rate (`lambda`), service rates (`mu`), number of servers (`c`), capacity (`cap`), and how much of the capacity is occupied at time=0 (`occupiedCap`). If customers should be rejected when downstream queues are full, set `rejectWhenFull = true`; otherwise `rejectWhenFull = false`.
42-
43-
```java
44-
double[] lambda = {2}; double[] mu = {1.5,4,2.5}; int[] c = {2,1,2}; int[] cap = {20,20,20};
45-
int[] occupiedCap = {0,0,0}; boolean rejectWhenFull = false;
46-
```
47-
48-
Create the model.
49-
50-
```java
51-
create network = new create(A,lambda,mu,c,cap,rejectWhenFull);
52-
```
53-
54-
Prepare the evaluation calculations by plugging the `network` object into `evaluate`.
55-
56-
```java
57-
evaluate system = new evaluate(occupiedCap,network);
58-
```
59-
60-
Evaluate the behavior of the system at time=5 with a precision of 1x10^-9.
61-
62-
```java
63-
system.uniformization(5,1e-9);
64-
```
65-
66-
Evaluate the steady-state behavior of the system (i.e. at time=Inf) with a precision of 1x10^-6.
67-
68-
```java
69-
system.gauss_seidel(1e-6);
70-
```
71-
72-
Get the marginal state distribution for each of the network queues.
73-
74-
```java
75-
double[][] dist = system.getMarginalDistributions();
76-
```
77-
78-
Get the expected number of customers within each queue node.
79-
80-
```java
81-
double[] expValue = system.expectedCustomers();
82-
```
83-
84-
Get the probability of waiting on arrival at each queue node.
85-
86-
```java
87-
double[] waitProb = system.waitingProbability();
88-
```
89-
90-
# Citing this library
91-
92-
[![DOI](https://zenodo.org/badge/175442551.svg)](https://zenodo.org/badge/latestdoi/175442551)
93-
94-
95-
Anders Reenberg Andersen. (2021). areenberg/mc_math: Converted to Maven project (v1.2). Zenodo. https://doi.org/10.5281/zenodo.5650104
96-
97-
# License
98-
Copyright 2021 Anders Reenberg Andersen, PhD
99-
100-
Licensed under the Apache License, Version 2.0 (the "License");
101-
you may not use this file except in compliance with the License.
102-
You may obtain a copy of the License at
103-
104-
http://www.apache.org/licenses/LICENSE-2.0
105-
106-
Unless required by applicable law or agreed to in writing, software
107-
distributed under the License is distributed on an "AS IS" BASIS,
108-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
109-
See the License for the specific language governing permissions and
110-
limitations under the License.
1+
# Introduction
2+
The purpose of this library is to provide a method for evaluating both transient and steady-state M/M/C/K single queues and queueing networks. The library has been designed to make this process as smooth as possible by restricting the input to the adjacency matrix and the basic parameters that characterize the system.
3+
4+
Using the library involves the following two steps:
5+
6+
**Step 1:** Construct the infinitesimal generator for the network at hand. This is handled automatically by the `create` class.
7+
8+
**Step 2:** Use the object created in the aforementioned step to retrieve the behavior of the network. This is handled by the `evaluate` class.
9+
10+
# Basic Overview
11+
12+
## Files
13+
14+
- `mc_math-1.2.jar`: The library file.
15+
16+
## Classes
17+
18+
- `create`: Automatically constructs the infinitesimal generator (the transition rate matrix) and various other parameters.
19+
20+
- `evaluate`: Uses an object defined with `create` to evaluate the queueing network.
21+
22+
# Getting Started
23+
Firstly, download and add `mc_math.jar` to your Java-project.
24+
25+
Now import the `queueing` classes.
26+
27+
```java
28+
import queueing.*;
29+
```
30+
31+
Define the weighted directed adjacency matrix using the structure: (1) Sources nodes, (2) queueing nodes, and (3) sink node. In this example, we have three queueing nodes. A single source node feeds all arriving customers into the first queueing node. The flow then splits into three parts sending 45% of the customers to queue 2, 30% to queue 3, and 25% to the sink node. Queue 2 and 3 send all customers to the sink after their service has been completed.
32+
33+
```java
34+
double[][] A = {{0,1,0,0,0},
35+
{0,0,0.45,0.30,0.25},
36+
{0,0,0,0,1},
37+
{0,0,0,0,1},
38+
{0,0,0,0,0}};
39+
```
40+
41+
Define the remaining characteristics of the system, i.e. the arrival rate (`lambda`), service rates (`mu`), number of servers (`c`), capacity (`cap`), and how much of the capacity is occupied at time=0 (`occupiedCap`). If customers should be rejected when downstream queues are full, set `rejectWhenFull = true`; otherwise `rejectWhenFull = false`.
42+
43+
```java
44+
double[] lambda = {2}; double[] mu = {1.5,4,2.5}; int[] c = {2,1,2}; int[] cap = {20,20,20};
45+
int[] occupiedCap = {0,0,0}; boolean rejectWhenFull = false;
46+
```
47+
48+
Create the model.
49+
50+
```java
51+
create network = new create(A,lambda,mu,c,cap,rejectWhenFull);
52+
```
53+
54+
Prepare the evaluation calculations by plugging the `network` object into `evaluate`.
55+
56+
```java
57+
evaluate system = new evaluate(occupiedCap,network);
58+
```
59+
60+
Evaluate the behavior of the system at time=5 with a precision of 1x10^-9.
61+
62+
```java
63+
system.uniformization(5,1e-9);
64+
```
65+
66+
Evaluate the steady-state behavior of the system (i.e. at time=Inf) with a precision of 1x10^-6.
67+
68+
```java
69+
system.gauss_seidel(1e-6);
70+
```
71+
72+
Get the marginal state distribution for each of the network queues.
73+
74+
```java
75+
double[][] dist = system.getMarginalDistributions();
76+
```
77+
78+
Get the expected number of customers within each queue node.
79+
80+
```java
81+
double[] expValue = system.expectedCustomers();
82+
```
83+
84+
Get the probability of waiting on arrival at each queue node.
85+
86+
```java
87+
double[] waitProb = system.waitingProbability();
88+
```
89+
90+
# Citing this library
91+
92+
[![DOI](https://zenodo.org/badge/175442551.svg)](https://zenodo.org/badge/latestdoi/175442551)
93+
94+
95+
Anders Reenberg Andersen. (2021). areenberg/mc_math: Converted to Maven project (v1.2). Zenodo. https://doi.org/10.5281/zenodo.5650104
96+
97+
# License
98+
Copyright 2021 Anders Reenberg Andersen, PhD
99+
100+
Licensed under the Apache License, Version 2.0 (the "License");
101+
you may not use this file except in compliance with the License.
102+
You may obtain a copy of the License at
103+
104+
http://www.apache.org/licenses/LICENSE-2.0
105+
106+
Unless required by applicable law or agreed to in writing, software
107+
distributed under the License is distributed on an "AS IS" BASIS,
108+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
109+
See the License for the specific language governing permissions and
110+
limitations under the License.

‎pom.xml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.mcmath</groupId>
5-
<artifactId>mc_math</artifactId>
6-
<version>1.2</version>
7-
<packaging>jar</packaging>
8-
<properties>
9-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10-
<maven.compiler.source>11</maven.compiler.source>
11-
<maven.compiler.target>11</maven.compiler.target>
12-
</properties>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.mcmath</groupId>
5+
<artifactId>mc_math</artifactId>
6+
<version>1.2</version>
7+
<packaging>jar</packaging>
8+
<properties>
9+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10+
<maven.compiler.source>11</maven.compiler.source>
11+
<maven.compiler.target>11</maven.compiler.target>
12+
</properties>
1313
</project>

0 commit comments

Comments
 (0)