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
7649aabc
Commit
7649aabc
authored
May 11, 2018
by
Simon Eismann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Exception for Concurrency == 0
parent
9d0224db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/DeterministicConcurrency.java
...ernel/loading/distributions/DeterministicConcurrency.java
+13
-0
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/DeterministicConcurrencyCreator.java
...oading/distributions/DeterministicConcurrencyCreator.java
+2
-2
No files found.
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/DeterministicConcurrency.java
View file @
7649aabc
...
...
@@ -41,19 +41,32 @@
package
de.tud.cs.simqpn.kernel.loading.distributions
;
import
java.util.Map
;
import
java.util.Map.Entry
;
public
class
DeterministicConcurrency
implements
AbstractDistribution
{
private
Map
<
Integer
,
Double
>
concurrencyLevels
;
private
Integer
min
=
-
1
;
private
String
colorRefId
;
public
DeterministicConcurrency
(
Map
<
Integer
,
Double
>
concurrencyLevels
,
String
colorRefId
)
{
if
(
concurrencyLevels
.
get
(
0
)
!=
null
)
throw
new
IllegalArgumentException
(
"Concurrency level can not be 0, as no response time can be calculated without a request"
);
this
.
concurrencyLevels
=
concurrencyLevels
;
this
.
colorRefId
=
colorRefId
;
for
(
Entry
<
Integer
,
Double
>
entry
:
this
.
concurrencyLevels
.
entrySet
())
if
(
entry
.
getKey
()
<
min
)
min
=
entry
.
getKey
();
}
@Override
public
double
nextDouble
(
int
concurrency
)
{
if
(
concurrency
<
min
)
return
concurrencyLevels
.
get
(
min
);
Double
resp
=
concurrencyLevels
.
get
(
concurrency
);
if
(
resp
==
null
)
throw
new
IllegalStateException
(
...
...
sources/qpme.simqpn.kernel/src/de/tud/cs/simqpn/kernel/loading/distributions/DeterministicConcurrencyCreator.java
View file @
7649aabc
...
...
@@ -74,7 +74,7 @@ public class DeterministicConcurrencyCreator extends DistributionCreator {
@Override
public
double
getMean
()
{
throw
new
IllegalStateException
(
"Cannot calculate mean for DeterministicConcurrency distribution"
)
;
return
-
1.0
;
}
@Override
...
...
@@ -84,6 +84,6 @@ public class DeterministicConcurrencyCreator extends DistributionCreator {
@Override
public
String
getMeanComputationText
()
{
throw
new
IllegalStateException
(
"Cannot calculate mean for DeterministicConcurrency distribution"
)
;
return
"Returning placeholder -1 for mean of DeterministicConcurrency Distribution"
;
}
}
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