Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qpme-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Descartes Research
qpme-core
Commits
24f0d9c3
Commit
24f0d9c3
authored
Aug 31, 2018
by
Simon Eismann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reworked interface
parent
667fdc05
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
31 additions
and
18 deletions
+31
-18
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/QPlace.java
...n.kernel/src/de/tud/cs/simqpn/kernel/entities/QPlace.java
+2
-3
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/PRIOQueue.java
...src/de/tud/cs/simqpn/kernel/entities/queue/PRIOQueue.java
+2
-2
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/PSQueue.java
...l/src/de/tud/cs/simqpn/kernel/entities/queue/PSQueue.java
+1
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/RANDOMQueue.java
...c/de/tud/cs/simqpn/kernel/entities/queue/RANDOMQueue.java
+2
-2
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/ThreadSchedulingQueue.java
...s/simqpn/kernel/entities/queue/ThreadSchedulingQueue.java
+1
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/AbstractDistribution.java
...pn/kernel/loading/distributions/AbstractDistribution.java
+3
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/AbstractDistributionWrapper.java
...el/loading/distributions/AbstractDistributionWrapper.java
+3
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/Deterministic.java
...cs/simqpn/kernel/loading/distributions/Deterministic.java
+3
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/DeterministicConcurrency.java
...ernel/loading/distributions/DeterministicConcurrency.java
+4
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/MARS.java
...c/de/tud/cs/simqpn/kernel/loading/distributions/MARS.java
+4
-3
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/Periodical.java
...ud/cs/simqpn/kernel/loading/distributions/Periodical.java
+3
-1
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/Replay.java
...de/tud/cs/simqpn/kernel/loading/distributions/Replay.java
+3
-1
No files found.
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/QPlace.java
View file @
24f0d9c3
...
...
@@ -197,7 +197,7 @@ public class QPlace extends Place {
}
else
if
(((
QPlace
)
original
).
randServTimeGen
[
c
].
getClass
()
.
equals
(
Deterministic
.
class
))
{
double
value
=
((
QPlace
)
original
).
randServTimeGen
[
c
]
.
nextDouble
(
-
1
,
null
,
null
);
.
nextDouble
(
null
,
-
1
);
this
.
randServTimeGen
[
c
]
=
new
Deterministic
(
value
);
}
else
{
// TODO implement copy of other distributions
...
...
@@ -494,8 +494,7 @@ public class QPlace extends Place {
*/
private
void
calculateServiceTimeIfFutureListIsEmpty
(
int
color
)
{
if
(
futureList
.
get
(
color
).
isEmpty
())
{
int
concurrency
=
queueTokenPop
[
color
];
double
serviceTime
=
randServTimeGen
[
color
].
nextDouble
(
concurrency
,
this
.
colors
,
this
.
queueTokenPop
);
double
serviceTime
=
randServTimeGen
[
color
].
nextDouble
(
this
,
color
);
if
(
serviceTime
<
0
)
{
serviceTime
=
0
;
}
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/PRIOQueue.java
View file @
24f0d9c3
...
...
@@ -89,7 +89,7 @@ public class PRIOQueue extends Queue {
int
n
=
0
;
while
(
n
<
count
&&
numBusyServers
<
numServers
)
{
// Schedule service completion event
double
servTime
=
queueingPlace
.
randServTimeGen
[
color
].
nextDouble
(
-
1
,
null
,
null
);
double
servTime
=
queueingPlace
.
randServTimeGen
[
color
].
nextDouble
(
null
,
-
1
);
if
(
servTime
<
0
)
servTime
=
0
;
Token
tk
=
(
tokensToBeAdded
!=
null
)
?
tokensToBeAdded
[
n
]
...
...
@@ -134,7 +134,7 @@ public class PRIOQueue extends Queue {
if
(!
priorityQueue
.
isEmpty
())
{
Token
tk
=
priorityQueue
.
remove
();
QPlace
qPl
=
(
QPlace
)
tk
.
place
;
double
servTime
=
qPl
.
randServTimeGen
[
tk
.
color
].
nextDouble
(
-
1
,
null
,
null
);
double
servTime
=
qPl
.
randServTimeGen
[
tk
.
color
].
nextDouble
(
null
,
-
1
);
if
(
servTime
<
0
)
{
servTime
=
0
;
executor
.
scheduleEvent
(
servTime
,
this
,
tk
);
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/PSQueue.java
View file @
24f0d9c3
...
...
@@ -257,7 +257,7 @@ public class PSQueue extends Queue {
((
Exponential
)
expRandServTimeGen
[
0
]).
setState
(
totServRate
);
randColorGen
.
setState2
(
pdf
);
double
servTime
=
expRandServTimeGen
[
0
].
nextDouble
(
-
1
,
null
,
null
);
double
servTime
=
expRandServTimeGen
[
0
].
nextDouble
(
null
,
-
1
);
if
(
servTime
<
0
)
servTime
=
0
;
int
color
=
randColorGen
.
nextInt
();
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/RANDOMQueue.java
View file @
24f0d9c3
...
...
@@ -113,7 +113,7 @@ public class RANDOMQueue extends Queue {
int
n
=
0
;
while
(
n
<
count
&&
numBusyServers
<
numServers
)
{
// Schedule service completion event
double
servTime
=
qPl
.
randServTimeGen
[
color
].
nextDouble
(
-
1
,
null
,
null
);
double
servTime
=
qPl
.
randServTimeGen
[
color
].
nextDouble
(
null
,
-
1
);
if
(
servTime
<
0
)
servTime
=
0
;
Token
tk
=
(
tokensToBeAdded
!=
null
)
?
tokensToBeAdded
[
n
]
...
...
@@ -147,7 +147,7 @@ public class RANDOMQueue extends Queue {
int
index
=
randomGenerator
.
nextInt
(
waitingLine
.
size
());
Token
tk
=
(
Token
)
waitingLine
.
remove
(
index
);
QPlace
qPl
=
(
QPlace
)
tk
.
place
;
double
servTime
=
qPl
.
randServTimeGen
[
tk
.
color
].
nextDouble
(
-
1
,
null
,
null
);
double
servTime
=
qPl
.
randServTimeGen
[
tk
.
color
].
nextDouble
(
null
,
-
1
);
if
(
servTime
<
0
)
servTime
=
0
;
executor
.
scheduleEvent
(
servTime
,
this
,
tk
);
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/entities/queue/ThreadSchedulingQueue.java
View file @
24f0d9c3
...
...
@@ -192,7 +192,7 @@ public class ThreadSchedulingQueue extends Queue {
tokenData
.
alreadyScheduled
=
true
;
tokenData
.
requiredProcessingTime
=
queingPlace
.
randServTimeGen
[
color
]
.
nextDouble
(
-
1
,
null
,
null
);
.
nextDouble
(
null
,
-
1
);
if
(
tokenData
.
requiredProcessingTime
<
0
)
{
tokenData
.
requiredProcessingTime
=
0
;
}
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/AbstractDistribution.java
View file @
24f0d9c3
package
de.tud.cs.simqpn.kernel.loading.distributions
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
public
interface
AbstractDistribution
{
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
);
public
double
nextDouble
(
QPlace
qplace
,
int
color
);
}
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/AbstractDistributionWrapper.java
View file @
24f0d9c3
package
de.tud.cs.simqpn.kernel.loading.distributions
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
public
class
AbstractDistributionWrapper
implements
AbstractDistribution
{
private
cern
.
jet
.
random
.
AbstractDistribution
innerDistribution
;
...
...
@@ -9,7 +11,7 @@ public class AbstractDistributionWrapper implements AbstractDistribution {
}
@Override
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
)
{
public
double
nextDouble
(
QPlace
qplace
,
int
color
)
{
return
innerDistribution
.
nextDouble
();
}
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/Deterministic.java
View file @
24f0d9c3
...
...
@@ -40,6 +40,8 @@
*/
package
de.tud.cs.simqpn.kernel.loading.distributions
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
/**
* A deterministic distribution that always returns the double passed to the
* constructor.
...
...
@@ -59,7 +61,7 @@ public class Deterministic implements AbstractDistribution {
}
@Override
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
)
{
public
double
nextDouble
(
QPlace
qplace
,
int
color
)
{
return
value
;
}
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/DeterministicConcurrency.java
View file @
24f0d9c3
...
...
@@ -43,6 +43,8 @@ package de.tud.cs.simqpn.kernel.loading.distributions;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
public
class
DeterministicConcurrency
implements
AbstractDistribution
{
private
Map
<
Integer
,
Double
>
concurrencyLevels
;
...
...
@@ -63,7 +65,8 @@ public class DeterministicConcurrency implements AbstractDistribution {
}
@Override
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
)
{
public
double
nextDouble
(
QPlace
qplace
,
int
color
)
{
int
concurrency
=
qplace
.
getQueueTokenPop
()[
color
];
if
(
concurrency
<
min
)
return
concurrencyLevels
.
get
(
min
);
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/MARS.java
View file @
24f0d9c3
...
...
@@ -43,6 +43,7 @@ package de.tud.cs.simqpn.kernel.loading.distributions;
import
cern.jet.random.Exponential
;
import
de.tud.cs.simqpn.kernel.RandomNumberGenerator
;
import
de.tud.cs.simqpn.kernel.SimQPNException
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
public
class
MARS
implements
AbstractDistribution
{
...
...
@@ -62,12 +63,12 @@ public class MARS implements AbstractDistribution {
}
@Override
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
)
{
public
double
nextDouble
(
QPlace
qplace
,
int
color
)
{
if
(
functions
==
null
)
createFunctions
(
colors
);
createFunctions
(
qplace
.
colors
);
double
result
=
constant
;
for
(
int
i
=
0
;
i
<
functions
.
length
;
i
++)
result
+=
functions
[
i
].
calculate
(
tokenNumbers
[
i
]);
result
+=
functions
[
i
].
calculate
(
qplace
.
getQueueTokenPop
()
[
i
]);
try
{
return
new
Exponential
(
1
/
result
,
RandomNumberGenerator
.
nextRandNumGen
()).
nextDouble
();
}
catch
(
SimQPNException
e
)
{
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/Periodical.java
View file @
24f0d9c3
...
...
@@ -41,6 +41,8 @@
*/
package
de.tud.cs.simqpn.kernel.loading.distributions
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
public
class
Periodical
implements
AbstractDistribution
{
private
final
double
[]
data
;
...
...
@@ -58,7 +60,7 @@ public class Periodical implements AbstractDistribution {
}
@Override
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
)
{
public
double
nextDouble
(
QPlace
qplace
,
int
color
)
{
double
result
=
data
[
currentPos
];
currentPos
=
(
currentPos
+
1
)
%
data
.
length
;
return
result
;
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/Replay.java
View file @
24f0d9c3
...
...
@@ -40,6 +40,8 @@
*/
package
de.tud.cs.simqpn.kernel.loading.distributions
;
import
de.tud.cs.simqpn.kernel.entities.QPlace
;
public
class
Replay
implements
AbstractDistribution
{
private
double
[]
replayValues
;
...
...
@@ -53,7 +55,7 @@ public class Replay implements AbstractDistribution {
}
@Override
public
double
nextDouble
(
int
concurrency
,
String
[]
colors
,
int
[]
tokenNumbers
)
{
public
double
nextDouble
(
QPlace
qplace
,
int
color
)
{
if
(
nextValue
==
replayValues
.
length
)
throw
new
IllegalStateException
(
"There are only "
+
replayValues
.
length
+
" values in the replayfile for the colorRef "
+
colorRefId
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment