Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
a43aac76
Commit
a43aac76
authored
Apr 19, 2018
by
Tobias Meuser
Browse files
Provide heading in DefaultVehicleInformationComponent
parent
421852b2
Changes
2
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
a43aac76
...
...
@@ -146,6 +146,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
_positons
.
get
(
pVehicleID
).
getPosition
();
}
@Override
public
double
getVehicleHeading
(
String
pVehicleID
)
{
return
_positons
.
get
(
pVehicleID
).
getHeading
();
}
@Override
public
Location
getVehiclePosition
(
double
pStep
,
String
pVehicleID
)
{
if
(
pStep
==
_step
)
{
...
...
src/de/tud/kom/p2psim/impl/vehicular/DefaultVehicleInformationComponent.java
View file @
a43aac76
...
...
@@ -87,6 +87,32 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
});
siSComponent
.
provide
().
nodeState
(
SiSTypes
.
HEADING
,
new
SiSDataCallback
<
Double
>()
{
@Override
public
Double
getValue
(
INodeID
pNodeID
,
SiSProviderHandle
pProviderHandle
)
throws
InformationNotAvailableException
{
if
(
pNodeID
==
getHost
().
getId
())
{
if
(
isValid
())
{
return
controller
.
getVehicleHeading
(
vehicleID
);
}
}
return
null
;
}
@Override
public
Set
<
INodeID
>
getObservedNodes
()
{
return
INodeID
.
getSingleIDSet
(
getHost
().
getId
());
}
@Override
public
SiSInfoProperties
getInfoProperties
()
{
return
new
SiSInfoProperties
();
}
});
if
(
pRouteKnown
)
{
siSComponent
.
provide
().
nodeState
(
SiSTypes
.
ROUTE
,
new
SiSDataCallback
<
RoadNetworkRoute
>()
{
...
...
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