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
3daeb5af
Commit
3daeb5af
authored
Sep 21, 2016
by
Christian Meyer
Browse files
Launcher.java: fixed issue of first output folder being empty
in batch mode
parent
30c83186
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/zmt/launcher/Launcher.java
View file @
3daeb5af
...
...
@@ -93,16 +93,8 @@ public class Launcher {
ZmtSimState
simState
=
createSimState
(
args
,
context
.
classLocator
);
Class
<?
extends
SimParams
>
paramsClass
=
simState
.
getParamsClass
();
SimParams
defaultParams
=
createDefaultParams
(
paramsClass
);
Mode
mode
=
args
.
getMode
();
ParamsUtil
.
getXStreamInstance
().
processAnnotations
(
paramsClass
);
if
(
mode
!=
null
)
{
Path
outputPath
=
context
.
outputPathGenerator
.
createPaths
(
simState
.
getClass
(),
mode
,
getWorkingDirectory
()).
iterator
().
next
();
simState
.
setOutputPath
(
outputPath
);
}
// export parameters if needed
try
{
if
(
args
.
getExportAutoParamsPath
()
!=
null
)
{
...
...
@@ -234,13 +226,30 @@ public class Launcher {
}
/**
* Creates the output path for non-batch runs.
*
* @author mey
*
*/
private
abstract
class
NonBatchProcessor
extends
LoadParamsProcessor
{
@Override
protected
void
process
(
LauncherArgs
args
,
ZmtSimState
simState
)
{
Path
outputPath
=
context
.
outputPathGenerator
.
createPaths
(
simState
.
getClass
(),
args
.
getMode
(),
getWorkingDirectory
()).
iterator
().
next
();
simState
.
setOutputPath
(
outputPath
);
}
}
/**
* Runs simulation for a single time.
*
* @author mey
*
*/
private
class
SingleProcessor
extends
LoadParams
Processor
{
private
class
SingleProcessor
extends
NonBatch
Processor
{
@Override
protected
void
process
(
LauncherArgs
args
,
ZmtSimState
simState
)
{
context
.
simulationLooper
.
loop
(
simState
,
args
.
getSimTime
(),
args
.
getPrintStatusInterval
());
...
...
@@ -253,7 +262,7 @@ public class Launcher {
* @author mey
*
*/
private
class
GuiProcessor
extends
LoadParams
Processor
{
private
class
GuiProcessor
extends
NonBatch
Processor
{
@Override
protected
void
process
(
LauncherArgs
args
,
final
ZmtSimState
simState
)
{
Class
<?
extends
ZmtGUIState
>
guiStateClass
;
...
...
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