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
API
Commits
82f714de
Commit
82f714de
authored
Nov 14, 2017
by
Tobias Meuser
Browse files
Minor changes
parent
3752262e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/component/vehicular/api/EdgeController.java
View file @
82f714de
package
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api
;
import
java.util.List
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
/**
...
...
@@ -77,4 +79,10 @@ public interface EdgeController {
* @return the observedAreaSet
*/
public
boolean
isObservedAreaSet
();
/**
* @param pLaneID
* @return
*/
List
<
Location
>
getLaneShape
(
String
pLaneID
);
}
src/de/tudarmstadt/maki/simonstrator/api/component/vehicular/information/NotificationBasedVehicularPointInformation.java
0 → 100755
View file @
82f714de
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of Simonstrator.KOM.
*
* Simonstrator.KOM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* PeerfactSim.KOM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information
;
import
java.util.ArrayList
;
import
java.util.List
;
import
de.tudarmstadt.maki.simonstrator.api.component.pubsub.Notification
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
/**
* Wrapper class for a notification.
*
* @author Tobias Meuser (tobias.meuser@kom.tu-darmstadt.de)
* @version 1.0 at 14.11.2017
*
*/
public
class
NotificationBasedVehicularPointInformation
implements
VehicularPointInformation
<
Object
>
{
private
Notification
_notification
;
public
NotificationBasedVehicularPointInformation
(
Notification
pNotification
)
{
_notification
=
pNotification
;
}
@Override
public
Location
getLocation
()
{
return
_notification
.
getAttribute
(
AvailableInformationAttributes
.
POSITION
.
getAttributeID
(),
Location
.
class
)
.
getValue
();
}
@Override
public
long
getDetectionDate
()
{
return
_notification
.
getAttribute
(
AvailableInformationAttributes
.
DATE
.
getAttributeID
(),
Long
.
class
).
getValue
();
}
@Override
public
<
T
>
void
setAttribute
(
AvailableInformationAttributes
pKey
,
T
pValue
)
{
throw
new
UnsupportedOperationException
(
getClass
().
getSimpleName
()
+
" is only a container class, no changes allowed!"
);
}
@Override
public
<
T
>
T
getAttribute
(
AvailableInformationAttributes
pKey
)
{
return
(
T
)
_notification
.
getAttribute
(
pKey
.
getAttributeID
(),
Object
.
class
).
getValue
();
}
@Override
public
List
<
AvailableInformationAttributes
>
getAvailableAttributes
()
{
return
new
ArrayList
<>();
}
@Override
public
<
T
>
boolean
hasAttribute
(
AvailableInformationAttributes
pKey
)
{
return
false
;
}
@Override
public
Object
getValue
()
{
return
_notification
.
getAttribute
(
AvailableInformationAttributes
.
VALUE
.
getAttributeID
(),
Object
.
class
)
.
getValue
();
}
@Override
public
RoadNetworkEdge
getEdge
()
{
return
_notification
.
getAttribute
(
AvailableInformationAttributes
.
EDGE
.
getAttributeID
(),
RoadNetworkEdge
.
class
)
.
getValue
();
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/vehicular/relevance/
SimpleEvent
RelevanceCalculationComponent.java
→
src/de/tudarmstadt/maki/simonstrator/api/component/vehicular/relevance/
FixedRange
RelevanceCalculationComponent.java
View file @
82f714de
...
...
@@ -29,17 +29,17 @@ import de.tudarmstadt.maki.simonstrator.api.Host;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.VehicularPointInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
SimpleEvent
RelevanceCalculationComponent
implements
EventRelevanceCalculationComponent
{
public
class
FixedRange
RelevanceCalculationComponent
implements
EventRelevanceCalculationComponent
{
private
final
int
DEPTH
;
private
Host
_host
;
public
SimpleEvent
RelevanceCalculationComponent
(
Host
pHost
,
int
pDepth
)
{
public
FixedRange
RelevanceCalculationComponent
(
Host
pHost
,
int
pDepth
)
{
_host
=
pHost
;
DEPTH
=
pDepth
;
}
public
SimpleEvent
RelevanceCalculationComponent
(
Host
pHost
)
{
public
FixedRange
RelevanceCalculationComponent
(
Host
pHost
)
{
this
(
pHost
,
5
);
}
...
...
src/de/tudarmstadt/maki/simonstrator/api/component/vehicular/roadnetwork/RoadNetworkEdge.java
View file @
82f714de
...
...
@@ -40,6 +40,8 @@ public class RoadNetworkEdge {
private
final
EdgeController
_edgeController
;
private
boolean
_active
=
false
;
public
RoadNetworkEdge
(
SerializableRoadNetworkEdge
pEdge
,
EdgeController
pEdgeController
)
{
_edgeController
=
pEdgeController
;
...
...
@@ -61,6 +63,21 @@ public class RoadNetworkEdge {
_angle
=
pAngle
;
}
/**
* @param pActive
* the active to set
*/
public
void
setActive
(
boolean
pActive
)
{
_active
=
pActive
;
}
/**
* @return the active
*/
public
boolean
isActive
()
{
return
_active
;
}
public
List
<
RoadNetworkLane
>
getLanes
()
{
return
_lanes
;
}
...
...
@@ -135,4 +152,15 @@ public class RoadNetworkEdge {
_maxSpeed
=
pMaxSpeed
;
_edgeController
.
setEdgeMaxSpeed
(
getEdgeID
(),
pMaxSpeed
);
}
public
List
<
List
<
Location
>>
getRoadShape
()
{
List
<
List
<
Location
>>
laneShapes
=
new
ArrayList
<>();
for
(
RoadNetworkLane
roadNetworkLane
:
_lanes
)
{
List
<
Location
>
laneShape
=
_edgeController
.
getLaneShape
(
roadNetworkLane
.
getLaneID
());
laneShapes
.
add
(
laneShape
);
}
return
laneShapes
;
}
}
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