Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
vadere
vadere
Commits
50fb0bca
Commit
50fb0bca
authored
Jan 18, 2019
by
Benedikt Zoennchen
Browse files
correct the timestamp computation and some gui stuff for the onlinesimulation.
parent
dce76186
Pipeline
#85058
failed with stages
in 54 seconds
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/components/model/DefaultConfig.java
View file @
50fb0bca
...
...
@@ -3,14 +3,15 @@ package org.vadere.gui.components.model;
import
java.awt.*
;
public
class
DefaultConfig
{
private
Color
obstacleColor
=
Color
.
BLACK
;
private
Color
sourceColor
=
Color
.
GREEN
;
private
Color
targetColor
=
Color
.
ORANGE
;
private
Color
obstacleColor
=
new
Color
(
0.7f
,
0.7f
,
0.7f
)
;
private
Color
sourceColor
=
new
Color
(
0.3333333333333333f
,
0.6588235294117647f
,
0.40784313725490196f
)
;
private
Color
targetColor
=
new
Color
(
0.8666666666666667f
,
0.51764705882352946f
,
0.32156862745098042f
)
;
private
Color
densityColor
=
Color
.
RED
;
private
Color
stairColor
=
Color
.
PINK
;
private
Color
pedestrianColor
=
Color
.
BLUE
;
private
Color
stairColor
=
new
Color
(
0.5058823529411764f
,
0.4470588235294118f
,
0.6980392156862745f
)
;
private
Color
pedestrianColor
=
new
Color
(
0.2980392156862745f
,
0.4470588235294118f
,
0.7901960784313725f
)
;
private
boolean
changed
=
false
;
public
DefaultConfig
()
{}
public
DefaultConfig
(
final
DefaultConfig
config
)
{
...
...
VadereGui/src/org/vadere/gui/onlinevisualization/OnlineVisualization.java
View file @
50fb0bca
...
...
@@ -24,6 +24,7 @@ public class OnlineVisualization implements PassiveCallback {
*/
public
class
ObservationAreaSnapshotData
{
public
final
double
simTimeInSec
;
public
final
int
simulationId
;
public
final
Topography
scenario
;
public
final
IPotentialField
potentialFieldTarget
;
public
final
Agent
selectedAgent
;
...
...
@@ -31,10 +32,12 @@ public class OnlineVisualization implements PassiveCallback {
public
ObservationAreaSnapshotData
(
final
double
simTimeInSec
,
final
int
simulationId
,
@NotNull
final
Topography
scenario
,
@Nullable
final
IPotentialField
potentialFieldTarget
,
@Nullable
final
IPotentialField
potentialField
,
@Nullable
final
Agent
selectedAgent
)
{
this
.
simulationId
=
simulationId
;
this
.
simTimeInSec
=
simTimeInSec
;
this
.
scenario
=
scenario
;
this
.
potentialFieldTarget
=
potentialFieldTarget
;
...
...
@@ -47,6 +50,7 @@ public class OnlineVisualization implements PassiveCallback {
private
OnlineVisualisationWindow
onlineVisualisationPanel
;
private
OnlineVisualizationModel
model
;
private
Topography
scenario
;
private
int
simulationId
;
/**
* Target potential.
...
...
@@ -67,6 +71,7 @@ public class OnlineVisualization implements PassiveCallback {
this
.
window
=
new
MainPanel
(
model
);
this
.
window
.
setVisible
(
enableVisualization
);
this
.
onlineVisualisationPanel
=
new
OnlineVisualisationWindow
(
window
,
model
);
this
.
simulationId
=
0
;
// this.window.addSelectShapeListener(onlineVisualisationPanel);
}
...
...
@@ -106,6 +111,11 @@ public class OnlineVisualization implements PassiveCallback {
this
.
model
.
notifyObservers
();
}
@Override
public
void
restart
(
double
simTimeInSec
)
{
simulationId
++;
}
/**
* Pushes (by copy) required data from current simulation into data queues
* for being displayed by draw thread (thread-safe). These may be for
...
...
@@ -125,12 +135,11 @@ public class OnlineVisualization implements PassiveCallback {
pedPotentialField
=
IPotentialField
.
copyAgentField
(
potentialField
,
selectedAgent
,
new
VRectangle
(
model
.
getTopographyBound
()),
0.1
);
}
ObservationAreaSnapshotData
data
=
new
ObservationAreaSnapshotData
(
simTimeInSec
,
scenario
.
clone
(),
pft
,
pedPotentialField
,
selectedAgent
);
ObservationAreaSnapshotData
data
=
new
ObservationAreaSnapshotData
(
simTimeInSec
,
simulationId
,
scenario
.
clone
(),
pft
,
pedPotentialField
,
selectedAgent
);
model
.
pushObservationAreaSnapshot
(
data
);
}
}
public
JPanel
getVisualizationPanel
()
{
return
onlineVisualisationPanel
;
}
...
...
VadereGui/src/org/vadere/gui/onlinevisualization/model/OnlineVisualizationModel.java
View file @
50fb0bca
...
...
@@ -43,6 +43,8 @@ public class OnlineVisualizationModel extends SimulationModel<DefaultSimulationC
private
double
simTimeInSec
;
private
int
simulationId
;
private
boolean
drawArrows
;
/**
...
...
@@ -107,6 +109,7 @@ public class OnlineVisualizationModel extends SimulationModel<DefaultSimulationC
OnlineVisualization
.
ObservationAreaSnapshotData
observationAreaSnapshot
=
observationAreaSnapshots
.
getFirst
();
simTimeInSec
=
observationAreaSnapshot
.
simTimeInSec
;
simulationId
=
observationAreaSnapshot
.
simulationId
;
// potentialFieldTarget might be null!
potentialFieldTarget
=
observationAreaSnapshot
.
potentialFieldTarget
;
...
...
@@ -144,11 +147,14 @@ public class OnlineVisualizationModel extends SimulationModel<DefaultSimulationC
.
map
(
ped
->
ped
.
getPosition
())
.
collect
(
Collectors
.
toList
()));
}
return
true
;
}
}
public
int
getSimulationId
()
{
return
simulationId
;
}
@Override
public
boolean
isTopgraphyAvailable
()
{
return
topography
!=
null
;
...
...
VadereGui/src/org/vadere/gui/onlinevisualization/view/OnlinevisualizationRenderer.java
View file @
50fb0bca
...
...
@@ -16,13 +16,18 @@ public class OnlinevisualizationRenderer extends SimulationRenderer {
private
final
OnlineVisualizationModel
model
;
private
static
final
double
MIN_ARROW_LENGTH
=
0.1
;
private
final
Map
<
Integer
,
VPoint
>
lastPedestrianPositions
;
private
final
Map
<
Integer
,
VPoint
>
pedestrianDirections
;
private
final
Map
<
Integer
,
LinkedList
<
VPoint
>>
pedestrianPositions
;
private
Map
<
Integer
,
VPoint
>
lastPedestrianPositions
;
private
Map
<
Integer
,
VPoint
>
pedestrianDirections
;
private
Map
<
Integer
,
LinkedList
<
VPoint
>>
pedestrianPositions
;
private
int
simulationId
=
0
;
public
OnlinevisualizationRenderer
(
final
OnlineVisualizationModel
model
)
{
super
(
model
);
this
.
model
=
model
;
init
();
}
private
void
init
()
{
this
.
pedestrianDirections
=
new
HashMap
<>();
this
.
lastPedestrianPositions
=
new
HashMap
<>();
this
.
pedestrianPositions
=
new
HashMap
<>();
...
...
@@ -32,6 +37,21 @@ public class OnlinevisualizationRenderer extends SimulationRenderer {
public
void
render
(
final
Graphics2D
targetGraphics2D
,
int
x
,
int
y
,
int
width
,
int
height
)
{
synchronized
(
model
.
getDataSynchronizer
())
{
if
(
model
.
popDrawData
())
{
if
(
simulationId
!=
model
.
getSimulationId
())
{
init
();
simulationId
=
model
.
getSimulationId
();
}
for
(
Agent
ped
:
model
.
getAgents
())
{
if
(!
pedestrianPositions
.
containsKey
(
ped
.
getId
()))
{
pedestrianPositions
.
put
(
ped
.
getId
(),
new
LinkedList
());
}
// reverse the point order
pedestrianPositions
.
get
(
ped
.
getId
()).
addFirst
(
ped
.
getPosition
());
}
super
.
render
(
targetGraphics2D
,
x
,
y
,
width
,
height
);
}
}
...
...
@@ -42,6 +62,21 @@ public class OnlinevisualizationRenderer extends SimulationRenderer {
public
void
render
(
final
Graphics2D
targetGraphics2D
,
int
width
,
int
height
)
{
synchronized
(
model
.
getDataSynchronizer
())
{
if
(
model
.
popDrawData
())
{
if
(
simulationId
!=
model
.
getSimulationId
())
{
init
();
simulationId
=
model
.
getSimulationId
();
}
for
(
Agent
ped
:
model
.
getAgents
())
{
if
(!
pedestrianPositions
.
containsKey
(
ped
.
getId
()))
{
pedestrianPositions
.
put
(
ped
.
getId
(),
new
LinkedList
());
}
// reverse the point order
pedestrianPositions
.
get
(
ped
.
getId
()).
addFirst
(
ped
.
getPosition
());
}
super
.
render
(
targetGraphics2D
,
width
,
height
);
}
}
...
...
@@ -63,13 +98,6 @@ public class OnlinevisualizationRenderer extends SimulationRenderer {
VPoint
position
=
ped
.
getPosition
();
agentRender
.
render
(
ped
,
nonGroupColor
,
g
);
if
(!
pedestrianPositions
.
containsKey
(
ped
.
getId
()))
{
pedestrianPositions
.
put
(
ped
.
getId
(),
new
LinkedList
());
}
// reverse the point order
pedestrianPositions
.
get
(
ped
.
getId
()).
addFirst
(
ped
.
getPosition
());
if
(
model
.
config
.
isShowTrajectories
())
{
renderTrajectory
(
g
,
pedestrianPositions
.
get
(
ped
.
getId
()),
ped
);
}
...
...
VadereModelTests/s2ucreSzenario/scenarios/bridge_coordinates_kai.scenario
View file @
50fb0bca
...
...
@@ -39,7 +39,7 @@
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" :
18
,
"stepCircleResolution" :
4
,
"numberOfCircles" : 1,
"varyStepDirection" : false,
"stepLengthIntercept" : 0.4625,
...
...
@@ -74,7 +74,7 @@
"targetAttractionStrength" : 1.0,
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "
UNIT
",
"type" : "
OBSTACLES
",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
...
...
VadereSimulator/src/org/vadere/simulator/control/OnlineSimulation.java
View file @
50fb0bca
...
...
@@ -180,6 +180,9 @@ public class OnlineSimulation extends Simulation implements Consumer<LinkedList<
logger
.
debug
(
"re-initialize simulation."
);
currentSimulationData
.
pedestrians
.
stream
().
forEach
(
ped
->
topography
.
addElement
(
ped
));
setStartTime
(
Utils
.
toSeconds
(
currentSimulationData
.
timestamp
));
for
(
PassiveCallback
passiveCallback
:
passiveCallbacks
)
{
passiveCallback
.
restart
(
simTimeInSec
);
}
resume
();
notifyAll
();
}
...
...
@@ -189,7 +192,7 @@ public class OnlineSimulation extends Simulation implements Consumer<LinkedList<
* Sends the current simulation state (pedestrians, time, place) using zeroMQ and protobuf.
*/
public
void
sendPedestrians
()
{
Timestamp
timestamp
=
Utils
.
addSeconds
(
currentSimulationData
.
t
imestamp
,
simTimeInSec
);
Timestamp
timestamp
=
Utils
.
toT
imestamp
(
simTimeInSec
);
for
(
DynamicElement
dynamicElement
:
topography
.
getPedestrianDynamicElements
().
getElements
())
{
Pedestrian
ped
=
(
Pedestrian
)
dynamicElement
;
sender
.
send
(
ped
,
timestamp
,
currentSimulationData
.
reference
);
...
...
VadereSimulator/src/org/vadere/simulator/control/PassiveCallback.java
View file @
50fb0bca
...
...
@@ -20,6 +20,8 @@ public interface PassiveCallback {
void
postUpdate
(
double
simTimeInSec
);
default
void
restart
(
double
simTimeInSec
)
{}
void
setTopography
(
Topography
scenario
);
default
void
setPotentialFieldTarget
(
@Nullable
IPotentialFieldTarget
potentialFieldTarget
){}
...
...
VadereSimulator/src/org/vadere/simulator/control/Simulation.java
View file @
50fb0bca
...
...
@@ -38,7 +38,7 @@ public class Simulation {
private
TopographyController
topographyController
;
private
DynamicElementFactory
dynamicElementFactory
;
pr
ivate
final
List
<
PassiveCallback
>
passiveCallbacks
;
pr
otected
final
List
<
PassiveCallback
>
passiveCallbacks
;
private
List
<
Model
>
models
;
protected
boolean
runSimulation
=
false
;
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/PedestrianOSM.java
View file @
50fb0bca
...
...
@@ -59,6 +59,7 @@ public class PedestrianOSM extends Pedestrian {
private
LinkedList
<
Pair
<
Double
,
Double
>>
strides
;
// left = length, right = time
private
StairStepOptimizer
stairStepOptimizer
;
private
Random
random
;
@SuppressWarnings
(
"unchecked"
)
PedestrianOSM
(
AttributesOSM
attributesOSM
,
...
...
@@ -97,6 +98,31 @@ public class PedestrianOSM extends Pedestrian {
this
.
lastPosition
=
getPosition
();
this
.
nextPosition
=
getPosition
();
this
.
strides
=
new
LinkedList
<>();
this
.
random
=
random
;
}
private
PedestrianOSM
(
@NotNull
PedestrianOSM
pedestrianOSM
)
{
super
(
pedestrianOSM
);
this
.
attributesOSM
=
pedestrianOSM
.
attributesOSM
;
this
.
stepCircleOptimizer
=
pedestrianOSM
.
stepCircleOptimizer
;
this
.
topography
=
pedestrianOSM
.
topography
;
this
.
stepLength
=
pedestrianOSM
.
stepLength
;
this
.
stepDeviation
=
pedestrianOSM
.
stepDeviation
;
this
.
minStepLength
=
pedestrianOSM
.
minStepLength
;
this
.
potentialFieldTarget
=
pedestrianOSM
.
potentialFieldTarget
;
this
.
potentialFieldObstacle
=
pedestrianOSM
.
potentialFieldObstacle
;
this
.
potentialFieldPedestrian
=
pedestrianOSM
.
potentialFieldPedestrian
;
this
.
speedAdjusters
=
pedestrianOSM
.
speedAdjusters
;
this
.
durationNextStep
=
pedestrianOSM
.
durationNextStep
;
this
.
nextPosition
=
pedestrianOSM
.
nextPosition
;
this
.
lastPosition
=
pedestrianOSM
.
lastPosition
;
this
.
timeCredit
=
pedestrianOSM
.
timeCredit
;
this
.
timeOfNextStep
=
pedestrianOSM
.
timeOfNextStep
;
this
.
relevantPedestrians
=
pedestrianOSM
.
relevantPedestrians
;
this
.
speedByAbsoluteDistance
=
pedestrianOSM
.
speedByAbsoluteDistance
;
this
.
strides
=
pedestrianOSM
.
strides
;
this
.
stairStepOptimizer
=
pedestrianOSM
.
stairStepOptimizer
;
this
.
random
=
pedestrianOSM
.
random
;
}
/*public void update(double timestamp, double currentTimeInSec, CallMethod callMethod) {
...
...
@@ -291,9 +317,11 @@ public class PedestrianOSM extends Pedestrian {
return
minStepLength
;
}
@Override
public
PedestrianOSM
clone
()
{
throw
new
RuntimeException
(
"clone is not supported for PedestrianOSM; it seems hard to implement."
);
return
new
PedestrianOSM
(
this
);
//throw new RuntimeException("clone is not supported for PedestrianOSM; it seems hard to implement.");
}
@Override
...
...
VadereState/src/org/vadere/state/scenario/Pedestrian.java
View file @
50fb0bca
...
...
@@ -53,7 +53,7 @@ public class Pedestrian extends Agent {
/**
* Copy constructor, references the same attributes.
*/
pr
ivate
Pedestrian
(
Pedestrian
other
)
{
pr
otected
Pedestrian
(
Pedestrian
other
)
{
super
(
other
);
modelPedestrianMap
=
new
HashMap
<>(
other
.
modelPedestrianMap
);
isChild
=
other
.
isChild
;
...
...
VadereState/src/org/vadere/state/scenario/Topography.java
View file @
50fb0bca
...
...
@@ -389,10 +389,10 @@ public class Topography {
s
.
addSource
((
Source
)
source
.
clone
());
}
for
(
Pedestrian
pedestrian
:
getElements
(
Pedestrian
.
class
))
{
s
.
addElement
(
pedestrian
);
s
.
addElement
(
pedestrian
.
clone
()
);
}
for
(
Pedestrian
ped
:
getInitialElements
(
Pedestrian
.
class
))
{
s
.
addInitialElement
(
ped
);
s
.
addInitialElement
(
ped
.
clone
()
);
}
for
(
Car
car
:
getElements
(
Car
.
class
))
{
s
.
addElement
(
car
);
...
...
VadereZMQ/src/org/vadere/s2ucre/Utils.java
View file @
50fb0bca
...
...
@@ -35,6 +35,16 @@ public class Utils {
.
build
();
}
public
static
Timestamp
toTimestamp
(
final
double
seconds
)
{
double
milliseconds
=
seconds
*
1000
;
long
sec
=
(
long
)(
milliseconds
/
1000
);
int
nano
=
(
int
)(
milliseconds
%
1000
)
*
1_000_000
;
return
Timestamp
.
newBuilder
()
.
setSeconds
(
sec
)
.
setNanos
(
nano
)
.
build
();
}
/*
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000 000)).build();
...
...
VadereZMQ/src/org/vadere/s2ucre/client/Receiver.java
View file @
50fb0bca
...
...
@@ -78,7 +78,7 @@ public class Receiver {
messageReceiver
=
()
->
{
while
(
running
)
{
LinkedList
<
Pedestrian
.
PedMsg
>
message
=
receivePedMsgs
();
logger
.
info
(
"consume: "
+
message
.
getFirst
()
);
logger
.
info
(
"consume: "
+
message
.
size
()
+
" pedestrians."
);
pedMsgConsumers
.
forEach
(
c
->
c
.
accept
(
message
));
}
};
...
...
@@ -94,7 +94,7 @@ public class Receiver {
try
{
// wait a certain amount of time such that running submission can finish their job
if
(!
executor
.
awaitTermination
(
1000
,
TimeUnit
.
MILLISECONDS
))
{
logger
.
info
(
"send was interrupted."
);
//
logger.info("send was interrupted.");
}
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
...
...
@@ -102,7 +102,7 @@ public class Receiver {
executor
.
shutdownNow
();
subscriber
.
close
();
}
logger
.
info
(
"receiver is closed."
);
//
logger.info("receiver is closed.");
}
public
void
addPedMsgConsumer
(
@NotNull
final
Consumer
<
LinkedList
<
Pedestrian
.
PedMsg
>>
consumer
)
{
...
...
@@ -116,20 +116,29 @@ public class Receiver {
if
(
pedMsgContainer
.
size
()
<
2
)
{
try
{
logger
.
info
(
"waiting for message "
+
Thread
.
currentThread
());
//
logger.info("waiting for message " + Thread.currentThread());
wait
();
logger
.
info
(
"woke up "
+
Thread
.
currentThread
());
//
logger.info("woke up " + Thread.currentThread());
return
receivePedMsgs
();
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
logger
.
warn
(
"interrupt while paused."
);
//
logger.warn("interrupt while paused.");
return
new
LinkedList
<>();
}
}
else
{
// return the second element since we can only be sure that it is complete i.e. we received all informations.
logger
.
info
(
"return information"
);
//
logger.info("return information");
Timestamp
secondMinTimeStep
=
pedMsgContainer
.
higherEntry
(
pedMsgContainer
.
firstKey
()).
getKey
();
return
pedMsgContainer
.
remove
(
secondMinTimeStep
);
// remove all older messages from the container
LinkedList
<
Pedestrian
.
PedMsg
>
newestCompleteMessage
=
pedMsgContainer
.
remove
(
secondMinTimeStep
);
while
((
pedMsgContainer
.
size
()
>
1
))
{
pedMsgContainer
.
remove
(
pedMsgContainer
.
lastKey
());
}
logger
.
info
(
"receive "
+
newestCompleteMessage
.
size
()
+
" agents to simulate."
);
return
newestCompleteMessage
;
}
}
...
...
@@ -141,7 +150,7 @@ public class Receiver {
*/
private
void
receivePedMsg
()
throws
InvalidProtocolBufferException
,
InterruptedException
{
while
(
running
)
{
logger
.
info
(
"Waiting for Message"
);
//
logger.info("Waiting for Message");
Pedestrian
.
PedMsg
msg
=
Pedestrian
.
PedMsg
.
parseFrom
(
subscriber
.
receive
());
//System.out.println(msg);
Timestamp
timestamp
=
msg
.
getTime
();
...
...
VadereZMQ/src/org/vadere/s2ucre/client/Sender.java
View file @
50fb0bca
...
...
@@ -80,14 +80,14 @@ public class Sender {
submittedSends
.
clear
();
}
logger
.
debug
(
"sender is closed."
);
//
logger.debug("sender is closed.");
}
public
synchronized
void
send
(
@NotNull
final
Pedestrian
pedestrian
,
@NotNull
final
Timestamp
timestamp
,
@NotNull
final
Common
.
UTMCoordinate
referenc
)
{
if
(
running
)
{
Runnable
runnable
=
()
->
{
org
.
vadere
.
s2ucre
.
generated
.
Pedestrian
.
PedMsg
simulatedPedestrians
=
toPedestrianAtTime
(
pedestrian
,
timestamp
,
referenc
);
logger
.
info
(
"send
:
"
+
simulatedPedestrians
.
toString
()
);
logger
.
info
(
"send
agent information:
"
+
simulatedPedestrians
);
publisher
.
send
(
simulatedPedestrians
.
toByteArray
());
};
submittedSends
.
add
(
executor
.
submit
(
runnable
));
...
...
VadereZMQ/src/org/vadere/s2ucre/translate/Translate.java
View file @
50fb0bca
...
...
@@ -27,7 +27,14 @@ public class Translate {
private
final
static
Logger
logger
=
LogManager
.
getLogger
(
Translate
.
class
);
/**
* IOSB-Informations
*/
private
Queue
<
IosbOutput
.
AreaInfoAtTime
>
inQueue
;
/**
* IOSB-Information translated into simulation data.
*/
private
Queue
<
Pedestrian
.
PedMsg
>
outQueue
;
private
ExecutorService
executor
;
...
...
@@ -63,7 +70,7 @@ public class Translate {
byte
[]
msgBytes
=
subscriber
.
receive
();
IosbOutput
.
AreaInfoAtTime
message
=
IosbOutput
.
AreaInfoAtTime
.
parseFrom
(
msgBytes
);
inQueue
.
add
(
message
);
logger
.
info
(
"
message received"
);
logger
.
info
(
"
received real world data: "
+
message
);
synchronized
(
inQueue
)
{
inQueue
.
notifyAll
();
...
...
@@ -82,7 +89,7 @@ public class Translate {
while
(
outQueue
.
isEmpty
())
{
synchronized
(
outQueue
)
{
try
{
logger
.
info
(
"wait for message to be translated."
);
//
logger.info("wait for message to be translated.");
outQueue
.
wait
();
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
...
...
@@ -100,7 +107,7 @@ public class Translate {
while
(
inQueue
.
isEmpty
())
{
synchronized
(
inQueue
)
{
try
{
logger
.
info
(
"wait for messages."
);
//
logger.info("wait for messages.");
inQueue
.
wait
();
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
...
...
@@ -111,11 +118,11 @@ public class Translate {
IosbOutput
.
AreaInfoAtTime
areaInfoAtTime
=
inQueue
.
poll
();
//logger.info(areaInfoAtTime.toString());
List
<
Pedestrian
.
PedMsg
>
pedMsgs
=
translate
(
areaInfoAtTime
);
logger
.
info
(
pedMsgs
);
//
logger.info(
areaInfoAtTime.getTime()
);
for
(
Pedestrian
.
PedMsg
pedMsg
:
pedMsgs
)
{
outQueue
.
add
(
pedMsg
);
}
logger
.
info
(
"message translated."
);
//
logger.info("message translated.");
synchronized
(
outQueue
)
{
outQueue
.
notifyAll
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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