Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
aa5a22ef
Commit
aa5a22ef
authored
Jul 17, 2019
by
Stefan Schuhbaeck
Browse files
fix performance problem. Use FastBufferedInputStream in cache handling.
parent
31720fe8
Pipeline
#135224
passed with stages
in 112 minutes and 26 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereScenarios/roVer/scenarios/mf_001.scenario
View file @
aa5a22ef
{
"name" : "mf_001",
"description" : "",
"release" : "1.
0
",
"release" : "1.
2
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -75,6 +75,8 @@
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
...
...
@@ -10776,26 +10778,7 @@
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
"attributesCar" : null
},
"eventInfos" : [ ]
}
...
...
VadereScenarios/roVer/scenarios/mf_small.scenario
View file @
aa5a22ef
{
"name" : "mf_small",
"description" : "",
"release" : "1.
0
",
"release" : "1.
2
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -75,6 +75,8 @@
"potentialFieldResolution" : 0.3,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
...
...
@@ -3130,26 +3132,7 @@
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
"attributesCar" : null
},
"eventInfos" : [ ]
}
...
...
VadereScenarios/roVer/scenarios/mf_small_simple.scenario
View file @
aa5a22ef
{
"name" : "mf_small_simple",
"description" : "",
"release" : "1.
0
",
"release" : "1.
2
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -75,6 +75,8 @@
"potentialFieldResolution" : 0.3,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
...
...
@@ -1969,27 +1971,8 @@
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
"attributesCar" : null
},
"eventInfos" : [ ]
}
}
}
\ No newline at end of file
VadereScenarios/roVer/scenarios/roVerTest001.scenario
View file @
aa5a22ef
{
"name" : "roVerTest001",
"description" : "",
"release" : "1.
0
",
"release" : "1.
2
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -94,6 +94,8 @@
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "BIN_CACHE",
"cacheDir" : "roVerTest001",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
...
...
@@ -269,26 +271,7 @@
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.2,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
"attributesCar" : null
},
"eventInfos" : [ ]
}
...
...
VadereScenarios/roVer/scenarios/scenario001.scenario
View file @
aa5a22ef
{
"name" : "scenario001",
"description" : "",
"release" : "1.
0
",
"release" : "1.
2
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -75,6 +75,8 @@
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
...
...
@@ -190,26 +192,7 @@
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.2,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
"attributesCar" : null
},
"eventInfos" : [ ]
}
...
...
VadereScenarios/roVer/scenarios/scenario002.scenario
View file @
aa5a22ef
{
"name" : "scenario002",
"description" : "",
"release" : "1.
0
",
"release" : "1.
2
",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
...
...
@@ -75,6 +75,8 @@
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
...
...
@@ -267,26 +269,7 @@
"targetOrientationAngleThreshold" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.2,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footStepsToStore" : 4,
"searchRadius" : 1.0,
"angleCalculationType" : "USE_CENTER",
"targetOrientationAngleThreshold" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
"attributesCar" : null
},
"eventInfos" : [ ]
}
...
...
VadereScenarios/roVer/vadere.project
View file @
aa5a22ef
roVer
roVer
\ No newline at end of file
VadereSimulator/src/org/vadere/simulator/utils/cache/CellGridBinaryCacheObject.java
View file @
aa5a22ef
package
org.vadere.simulator.utils.cache
;
import
it.unimi.dsi.fastutil.io.FastBufferedInputStream
;
import
org.vadere.util.data.cellgrid.CellGrid
;
import
org.vadere.util.data.cellgrid.CellGridReadWriter
;
import
org.vadere.util.logging.Logger
;
import
java.io.DataInputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
public
class
CellGridBinaryCacheObject
extends
AbstractCacheObject
implements
ICellGridCacheObject
{
...
...
@@ -24,7 +25,7 @@ public class CellGridBinaryCacheObject extends AbstractCacheObject implements IC
@Override
public
void
initializeObjectFromCache
(
CellGrid
object
)
throws
CacheException
{
try
{
CellGridReadWriter
.
read
(
object
).
fromBinary
(
new
DataInputStream
(
new
F
ile
InputStream
(
cacheLocation
)));
CellGridReadWriter
.
read
(
object
).
fromBinary
(
new
DataInputStream
(
new
F
astBuffered
InputStream
(
inputStream
)));
}
catch
(
Exception
e
)
{
throw
new
CacheException
(
"Cannot load cache from CSV InputStream"
,
e
);
}
...
...
VadereSimulator/src/org/vadere/simulator/utils/cache/CellGridTxtCacheObject.java
View file @
aa5a22ef
package
org.vadere.simulator.utils.cache
;
import
it.unimi.dsi.fastutil.io.FastBufferedInputStream
;
import
org.vadere.util.data.cellgrid.CellGrid
;
import
org.vadere.util.data.cellgrid.CellGridReadWriter
;
import
org.vadere.util.logging.Logger
;
...
...
@@ -21,7 +23,7 @@ public class CellGridTxtCacheObject extends AbstractCacheObject implements ICell
@Override
public
void
initializeObjectFromCache
(
CellGrid
object
)
throws
CacheException
{
try
{
CellGridReadWriter
.
read
(
object
).
fromTextFile
(
inputStream
);
CellGridReadWriter
.
read
(
object
).
fromTextFile
(
new
FastBufferedInputStream
(
inputStream
)
)
;
}
catch
(
Exception
e
)
{
throw
new
CacheException
(
"Cannot load cache from TXT InputStream"
,
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