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
54226c4b
Commit
54226c4b
authored
Apr 19, 2018
by
Tobias Meuser
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Provide heading in DefaultVehicleInformationComponent
parent
cdb43de3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
54226c4b
...
@@ -220,6 +220,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
...
@@ -220,6 +220,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
}
}
@Override
@Override
public
double
getVehicleHeading
(
String
pVehicleID
)
{
return
_positons
.
get
(
pVehicleID
).
getHeading
();
}
@Override
public
Location
getVehiclePosition
(
double
pStep
,
String
pVehicleID
)
{
public
Location
getVehiclePosition
(
double
pStep
,
String
pVehicleID
)
{
if
(
pStep
==
_step
)
{
if
(
pStep
==
_step
)
{
return
getVehiclePosition
(
pVehicleID
);
return
getVehiclePosition
(
pVehicleID
);
...
...
src/de/tud/kom/p2psim/impl/vehicular/DefaultVehicleInformationComponent.java
View file @
54226c4b
...
@@ -88,6 +88,32 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
...
@@ -88,6 +88,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
)
{
if
(
pRouteKnown
)
{
siSComponent
.
provide
().
nodeState
(
SiSTypes
.
ROUTE
,
new
SiSDataCallback
<
RoadNetworkRoute
>()
{
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