Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
vadere
vadere
Commits
08ad17b3
Commit
08ad17b3
authored
Nov 12, 2016
by
Jakob Schöttl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor ScenarioFactory
parent
edd7d9d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
15 deletions
+5
-15
VadereSimulator/src/org/vadere/simulator/entrypoints/ScenarioFactory.java
...src/org/vadere/simulator/entrypoints/ScenarioFactory.java
+4
-14
VadereSimulator/src/org/vadere/simulator/entrypoints/VadereConsole.java
...r/src/org/vadere/simulator/entrypoints/VadereConsole.java
+1
-1
No files found.
VadereSimulator/src/org/vadere/simulator/entrypoints/
Vadere
Factory.java
→
VadereSimulator/src/org/vadere/simulator/entrypoints/
Scenario
Factory.java
View file @
08ad17b3
package
org.vadere.simulator.entrypoints
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.Logger
;
import
org.vadere.simulator.projects.Scenario
;
import
org.vadere.simulator.projects.io.IOVadere
;
import
org.vadere.util.io.IOUtils
;
...
...
@@ -11,23 +9,15 @@ import java.nio.file.Files;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
/**
* The VadereFactory create new Vadere-Scenario objects.
*
*/
public
class
VadereFactory
{
private
static
Logger
logger
=
LogManager
.
getLogger
(
VadereFactory
.
class
);
public
class
ScenarioFactory
{
/**
* Create a new
Vadere
with the specified name based on the path
to the directory of the project
* and the filename of the scenario
of the Vadere
.
* Create a new
{@link Scenario}
with the specified name based on the path
*
to the directory of the project
and the filename of the scenario.
*
* @param projectdirectory directory to the addressed project
* @param name name of the new
Vadere object
* @param name name of the new
scenario
* @param fileName filename of the addressed scenario
* @return a new Vadere object
* @throws IOException if something goes wrong creatin the output folders of the project
*/
public
static
Scenario
createVadereWithProjectDirectory
(
final
String
projectdirectory
,
final
String
fileName
,
final
String
name
)
throws
IOException
{
...
...
VadereSimulator/src/org/vadere/simulator/entrypoints/VadereConsole.java
View file @
08ad17b3
...
...
@@ -70,7 +70,7 @@ public class VadereConsole {
logger
.
info
(
String
.
format
(
"Running VADERE on %s..."
,
scenarioFilePath
));
try
{
Scenario
scenario
=
Vadere
Factory
.
createVadereWithProjectDirectory
(
projectDirectory
,
Scenario
scenario
=
Scenario
Factory
.
createVadereWithProjectDirectory
(
projectDirectory
,
vadereName
+
IOUtils
.
SCENARIO_FILE_EXTENSION
,
vadereName
);
new
ScenarioRun
(
scenario
).
run
();
}
catch
(
IOException
e
)
{
...
...
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