Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ecomod
zmt-launcher
Commits
30c83186
Commit
30c83186
authored
Sep 21, 2016
by
Christian Meyer
Browse files
DefaultSimulationLooper.java: status message is created by simulation state
build.gradle changed dependency for zmt-core to 0.17
parent
7beda9a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
30c83186
...
...
@@ -21,7 +21,7 @@ description = "Library for launching ZMT simulations"
dependencies
{
compile
group:
'args4j'
,
name:
'args4j'
,
version:
'2.+'
compile
'de.zmt:zmt-core:0.1
1
.0'
compile
'de.zmt:zmt-core:0.1
7
.0'
// configuration needed when converted to project dependency
testCompile
group:
'de.zmt'
,
name:
'zmt-core'
,
version:
'0.+'
,
classifier:
'test'
,
configuration:
'test'
...
...
src/main/java/de/zmt/launcher/strategies/DefaultSimulationLooper.java
View file @
30c83186
...
...
@@ -4,7 +4,6 @@ import java.io.IOException;
import
java.lang.reflect.InvocationTargetException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.text.NumberFormat
;
import
java.time.Duration
;
import
java.util.Iterator
;
import
java.util.concurrent.ExecutorService
;
...
...
@@ -29,14 +28,6 @@ class DefaultSimulationLooper implements SimulationLooper {
private
static
final
Logger
logger
=
Logger
.
getLogger
(
DefaultSimulationLooper
.
class
.
getName
());
private
static
final
double
NANO_FACTOR
=
1
e
-
09
;
/** {@link NumberFormat} for simulation step rates. */
private
static
final
NumberFormat
RATE_FORMAT
;
static
{
RATE_FORMAT
=
NumberFormat
.
getInstance
();
RATE_FORMAT
.
setMaximumFractionDigits
(
5
);
RATE_FORMAT
.
setMinimumIntegerDigits
(
1
);
}
@Override
public
void
loop
(
ZmtSimState
simState
,
double
simTime
,
int
printStatusInterval
)
{
...
...
@@ -119,10 +110,9 @@ class DefaultSimulationLooper implements SimulationLooper {
while
(
schedule
.
step
(
simState
)
&&
schedule
.
getTime
()
<
simTime
)
{
long
steps
=
schedule
.
getSteps
();
if
(
printStatusInterval
>
0
&&
steps
>
0
&&
steps
%
printStatusInterval
==
0
)
{
double
rate
=
printStatusInterval
/
(
NANO_FACTOR
*
(
System
.
nanoTime
()
-
systemTimeLastInterval
));
logger
.
info
(
"Job "
+
job
+
"/"
+
jobCount
+
": "
+
"Steps: "
+
steps
+
" Time: "
+
schedule
.
getTimestamp
(
"At Start"
,
"Done"
)
+
" Rate: "
+
RATE_FORMAT
.
format
(
rate
)
+
" steps/s"
);
double
stepRatePerS
=
printStatusInterval
/
(
NANO_FACTOR
*
(
System
.
nanoTime
()
-
systemTimeLastInterval
));
logger
.
info
(
"Job "
+
job
+
"/"
+
jobCount
+
": "
+
simState
.
createStatusMessage
(
stepRatePerS
));
systemTimeLastInterval
=
System
.
nanoTime
();
}
}
...
...
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