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
eeeb8d71
Commit
eeeb8d71
authored
Oct 01, 2018
by
Tobias Meuser
Browse files
First working version of Gateway Selection
parent
6c78240c
Changes
28
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/AbstractRoadProperty.java
View file @
eeeb8d71
...
@@ -78,18 +78,17 @@ public abstract class AbstractRoadProperty implements RoadProperty, AggregatedPr
...
@@ -78,18 +78,17 @@ public abstract class AbstractRoadProperty implements RoadProperty, AggregatedPr
}
}
@Override
@Override
public
boolean
isAggregated
()
{
public
int
hashCode
()
{
return
_aggregationInformation
!=
null
;
if
(
_location
!=
null
)
{
}
return
_location
.
hashCode
();
}
else
{
@Override
return
_edge
.
hashCode
();
public
final
int
hashCode
()
{
}
return
getEdge
().
getEdgeID
().
hashCode
();
}
}
@Override
@Override
public
double
getCostsForMissingInformation
()
{
public
boolean
isAggregated
()
{
return
1
;
return
_aggregationInformation
!=
null
;
}
}
@Override
@Override
...
@@ -101,4 +100,17 @@ public abstract class AbstractRoadProperty implements RoadProperty, AggregatedPr
...
@@ -101,4 +100,17 @@ public abstract class AbstractRoadProperty implements RoadProperty, AggregatedPr
public
int
compareTo
(
RoadProperty
pO
)
{
public
int
compareTo
(
RoadProperty
pO
)
{
return
Long
.
compare
(
getDetectionDate
(),
pO
.
getDetectionDate
());
return
Long
.
compare
(
getDetectionDate
(),
pO
.
getDetectionDate
());
}
}
@Override
public
boolean
equals
(
Object
pObj
)
{
if
(
pObj
instanceof
AbstractRoadProperty
)
{
AbstractRoadProperty
property
=
(
AbstractRoadProperty
)
pObj
;
if
(
property
.
getClass
().
equals
(
getClass
()))
{
return
(
_location
==
property
.
_location
||
(
_location
!=
null
&&
_location
.
equals
(
property
.
_location
)))
&&
getValue
().
equals
(
property
.
getValue
())
&&
_edge
.
equals
(
property
.
_edge
)
&&
_detectionDate
==
property
.
_detectionDate
;
}
}
return
false
;
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/RoadProperty.java
View file @
eeeb8d71
...
@@ -39,7 +39,5 @@ public interface RoadProperty extends LocationBasedEnvironmentProperty, Aggregat
...
@@ -39,7 +39,5 @@ public interface RoadProperty extends LocationBasedEnvironmentProperty, Aggregat
Object
getValue
();
Object
getValue
();
double
getCostsForMissingInformation
();
boolean
equalLocation
(
RoadProperty
pRoadProperty
);
boolean
equalLocation
(
RoadProperty
pRoadProperty
);
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/BumpProperty.java
→
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/
bump/
BumpProperty.java
View file @
eeeb8d71
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
*/
*/
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
;
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
.bump
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.AbstractRoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.EnvironmentProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
...
@@ -52,14 +54,4 @@ public class BumpProperty extends AbstractRoadProperty {
...
@@ -52,14 +54,4 @@ public class BumpProperty extends AbstractRoadProperty {
return
hasBump
();
return
hasBump
();
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
BumpProperty
)
{
BumpProperty
bumpProperty
=
(
BumpProperty
)
obj
;
return
bumpProperty
.
getEdge
().
equals
(
getEdge
())
&&
(
bumpProperty
.
hasBump
()
==
hasBump
());
}
return
super
.
equals
(
obj
);
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/bump/BumpPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.bump
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.generator.RoadPropertyGenerator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
BumpPropertyGenerator
implements
RoadPropertyGenerator
{
@Override
public
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
)
{
return
new
BumpProperty
(
pLocation
,
pEdge
,
true
);
}
@Override
public
Class
<?
extends
RoadProperty
>
getGenerateClass
()
{
return
BumpProperty
.
class
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/costs/DefaultPropertyCostEstimator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.costs
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.bump.BumpProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.hazard.HazardProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.jam.JamProperty
;
public
class
DefaultPropertyCostEstimator
implements
PropertyCostEstimator
{
@Override
public
double
calculateCosts
(
Class
<?
extends
RoadProperty
>
pProperty
)
{
if
(
pProperty
.
equals
(
JamProperty
.
class
))
{
return
Math
.
pow
(
10
,
4
);
}
else
if
(
pProperty
.
equals
(
BumpProperty
.
class
))
{
return
Math
.
pow
(
10
,
-
2
);
}
else
if
(
pProperty
.
equals
(
HazardProperty
.
class
))
{
return
Math
.
pow
(
10
,
6
);
}
return
1
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/costs/PropertyCostEstimator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.costs
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
public
interface
PropertyCostEstimator
{
default
double
calculateCosts
(
RoadProperty
pProperty
)
{
return
calculateCosts
(
pProperty
.
getClass
());
}
double
calculateCosts
(
Class
<?
extends
RoadProperty
>
pProperty
);
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/costs/PropertyCostEstimatorFactory.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.costs
;
public
class
PropertyCostEstimatorFactory
{
private
static
DefaultPropertyCostEstimator
_costEstimator
=
new
DefaultPropertyCostEstimator
();
public
static
PropertyCostEstimator
getPropertyCostEstimator
()
{
return
_costEstimator
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/FogProperty.java
→
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/
fog/
FogProperty.java
View file @
eeeb8d71
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
*/
*/
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
;
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
.fog
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.AbstractRoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.EnvironmentProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
...
@@ -51,15 +53,4 @@ public class FogProperty extends AbstractRoadProperty {
...
@@ -51,15 +53,4 @@ public class FogProperty extends AbstractRoadProperty {
public
Object
getValue
()
{
public
Object
getValue
()
{
return
hasFog
();
return
hasFog
();
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
FogProperty
)
{
FogProperty
fogProperty
=
(
FogProperty
)
obj
;
return
fogProperty
.
getEdge
().
equals
(
getEdge
())
&&
(
fogProperty
.
hasFog
()
==
hasFog
());
}
return
super
.
equals
(
obj
);
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/fog/FogPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.fog
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.generator.RoadPropertyGenerator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
FogPropertyGenerator
implements
RoadPropertyGenerator
{
@Override
public
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
)
{
return
new
FogProperty
(
pLocation
,
pEdge
,
true
);
}
@Override
public
Class
<?
extends
RoadProperty
>
getGenerateClass
()
{
return
FogProperty
.
class
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/generator/RoadPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.generator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
interface
RoadPropertyGenerator
{
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
);
Class
<?
extends
RoadProperty
>
getGenerateClass
();
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/HazardProperty.java
→
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/
hazard/
HazardProperty.java
View file @
eeeb8d71
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
*/
*/
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
;
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
.hazard
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.AbstractRoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.EnvironmentProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
...
@@ -52,19 +54,4 @@ public class HazardProperty extends AbstractRoadProperty {
...
@@ -52,19 +54,4 @@ public class HazardProperty extends AbstractRoadProperty {
return
hasHazard
();
return
hasHazard
();
}
}
@Override
public
double
getCostsForMissingInformation
()
{
return
Math
.
pow
(
10
,
6
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
HazardProperty
)
{
HazardProperty
hazardProperty
=
(
HazardProperty
)
obj
;
return
hazardProperty
.
getEdge
().
equals
(
getEdge
())
&&
(
hazardProperty
.
hasHazard
()
==
hasHazard
());
}
return
super
.
equals
(
obj
);
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/hazard/HazardPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.hazard
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.generator.RoadPropertyGenerator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
HazardPropertyGenerator
implements
RoadPropertyGenerator
{
@Override
public
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
)
{
return
new
HazardProperty
(
pLocation
,
pEdge
,
true
);
}
@Override
public
Class
<?
extends
RoadProperty
>
getGenerateClass
()
{
return
HazardProperty
.
class
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/jam/JamProperty.java
View file @
eeeb8d71
...
@@ -91,19 +91,4 @@ public class JamProperty extends AbstractRoadProperty {
...
@@ -91,19 +91,4 @@ public class JamProperty extends AbstractRoadProperty {
return
getAverageSpeed
();
return
getAverageSpeed
();
}
}
@Override
public
double
getCostsForMissingInformation
()
{
return
Math
.
pow
(
10
,
4
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
JamProperty
)
{
JamProperty
jamProperty
=
(
JamProperty
)
obj
;
return
jamProperty
.
getEdge
().
equals
(
getEdge
())
&&
(
jamProperty
.
getAverageSpeed
()
==
getAverageSpeed
());
}
return
super
.
equals
(
obj
);
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/jam/JamPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.jam
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.generator.RoadPropertyGenerator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
JamPropertyGenerator
implements
RoadPropertyGenerator
{
@Override
public
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
)
{
return
new
JamProperty
(
pLocation
,
pEdge
,
true
,
pEdge
.
getMaxSpeed
()
*
0.5
);
}
@Override
public
Class
<?
extends
RoadProperty
>
getGenerateClass
()
{
return
JamProperty
.
class
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/jam/VectoralJamProperty.java
View file @
eeeb8d71
...
@@ -76,35 +76,6 @@ public class VectoralJamProperty extends NumericVectoralProperty {
...
@@ -76,35 +76,6 @@ public class VectoralJamProperty extends NumericVectoralProperty {
}
}
}
}
// private void setSimpleSpeed(double pSpeed, double pAccuracy) {
// double[] valueProbabilities = getValueProbabilities();
// Arrays.fill(valueProbabilities, 0);
// int index = (int) (pSpeed / SCALING);
// valueProbabilities[index] += pAccuracy;
//
// if (index + 1 < valueProbabilities.length) {
// valueProbabilities[index + 1] += (1 - pAccuracy) / 2.0;
// } else {
// valueProbabilities[index - 1] += (1 - pAccuracy) / 2.0;
// }
//
// if (index - 1 >= 1) {
// valueProbabilities[index - 1] += (1 - pAccuracy) / 2.0;
// } else {
// valueProbabilities[index + 1] += (1 - pAccuracy) / 2.0;
// }
// }
//
// public void setGaussianSpeedWithAccuracy(double pSpeed, double pAccuracy)
// {
// double deviation = determineCorrectDeviation(pSpeed, pAccuracy);
// setGaussianProbabilities(pSpeed / SCALING, deviation / SCALING);
// }
//
// public void setGaussianSpeed(double pSpeed, double pDeviation) {
// setGaussianProbabilities(pSpeed / SCALING, pDeviation / SCALING);
// }
@Override
@Override
public
VectoralJamProperty
clone
()
{
public
VectoralJamProperty
clone
()
{
VectoralJamProperty
vectoralJamProperty
=
new
VectoralJamProperty
(
getLocation
(),
getEdge
());
VectoralJamProperty
vectoralJamProperty
=
new
VectoralJamProperty
(
getLocation
(),
getEdge
());
...
@@ -200,39 +171,4 @@ public class VectoralJamProperty extends NumericVectoralProperty {
...
@@ -200,39 +171,4 @@ public class VectoralJamProperty extends NumericVectoralProperty {
return
(
int
)
(
RoadNetworkEdge
.
getCorrespondingState
(
getEdge
().
getOriginalMaxSpeed
())
/
SCALING
);
return
(
int
)
(
RoadNetworkEdge
.
getCorrespondingState
(
getEdge
().
getOriginalMaxSpeed
())
/
SCALING
);
}
}
// public double determineCorrectDeviation(double speed, double pAccuracy) {
// if (!_requiredStandardDeviation.containsKey(speed)) {
// if (pAccuracy < 1) {
// VectoralJamProperty vectoralJamProperty = new VectoralJamProperty(null,
// null);
//
// double deviation = 10;
//
// boolean reduceChange = false;
// double currentChange = deviation / 2;
//
// do {
// vectoralJamProperty.setGaussianSpeed(speed, deviation);
// if (vectoralJamProperty.getProbabilityForValue(speed) > pAccuracy) {
// deviation += currentChange;
// } else {
// deviation -= currentChange;
// reduceChange = true;
// }
//
// if (reduceChange) {
// currentChange /= 2.0;
// }
// } while (Math.round(vectoralJamProperty.getProbabilityForValue(speed) *
// 10000) != Math
// .round(pAccuracy * 10000));
//
// _requiredStandardDeviation.put(speed, deviation);
// } else {
// _requiredStandardDeviation.put(speed, 0d);
// }
// }
//
// return _requiredStandardDeviation.get(speed);
// }
}
}
\ No newline at end of file
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/RainProperty.java
→
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/
rain/
RainProperty.java
View file @
eeeb8d71
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
*/
*/
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
;
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
.rain
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.AbstractRoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.EnvironmentProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
...
@@ -51,15 +53,4 @@ public class RainProperty extends AbstractRoadProperty {
...
@@ -51,15 +53,4 @@ public class RainProperty extends AbstractRoadProperty {
public
Object
getValue
()
{
public
Object
getValue
()
{
return
hasRain
();
return
hasRain
();
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
RainProperty
)
{
RainProperty
rainProperty
=
(
RainProperty
)
obj
;
return
rainProperty
.
getEdge
().
equals
(
getEdge
())
&&
(
rainProperty
.
hasRain
()
==
hasRain
());
}
return
super
.
equals
(
obj
);
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/rain/RainPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.rain
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.generator.RoadPropertyGenerator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
RainPropertyGenerator
implements
RoadPropertyGenerator
{
@Override
public
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
)
{
return
new
RainProperty
(
pLocation
,
pEdge
,
true
);
}
@Override
public
Class
<?
extends
RoadProperty
>
getGenerateClass
()
{
return
RainProperty
.
class
;
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/roadcondition/VectoralRoadConditionProperty.java
View file @
eeeb8d71
...
@@ -141,20 +141,6 @@ public class VectoralRoadConditionProperty extends VectoralProperty {
...
@@ -141,20 +141,6 @@ public class VectoralRoadConditionProperty extends VectoralProperty {
return
0
;
return
0
;
}
}
@Override
public
boolean
equals
(
Object
pObj
)
{
if
(
pObj
instanceof
VectoralRoadConditionProperty
)
{
VectoralRoadConditionProperty
property
=
(
VectoralRoadConditionProperty
)
pObj
;
if
(
property
.
getMostProbableValue
().
equals
(
getMostProbableValue
()))
{
return
true
;
}
return
false
;
}
return
super
.
equals
(
pObj
);
}
@Override
@Override
public
int
getDefaultIndex
()
{
public
int
getDefaultIndex
()
{
return
0
;
return
0
;
...
...
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/TrafficSignProperty.java
→
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/
trafficsign/
TrafficSignProperty.java
View file @
eeeb8d71
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
*/
*/
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
;
package
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data
.trafficsign
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.AbstractRoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.EnvironmentProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
...
@@ -51,15 +53,4 @@ public class TrafficSignProperty extends AbstractRoadProperty {
...
@@ -51,15 +53,4 @@ public class TrafficSignProperty extends AbstractRoadProperty {
public
Object
getValue
()
{
public
Object
getValue
()
{
return
hasSign
();
return
hasSign
();
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
TrafficSignProperty
)
{
TrafficSignProperty
signProperty
=
(
TrafficSignProperty
)
obj
;
return
signProperty
.
getEdge
().
equals
(
getEdge
())
&&
(
signProperty
.
hasSign
()
==
hasSign
());
}
return
super
.
equals
(
obj
);
}
}
}
src/de/tudarmstadt/maki/simonstrator/api/component/sensor/environment/data/trafficsign/TrafficSignPropertyGenerator.java
0 → 100755
View file @
eeeb8d71
/*
* 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.sensor.environment.data.trafficsign
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.generator.RoadPropertyGenerator
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
TrafficSignPropertyGenerator
implements
RoadPropertyGenerator
{
@Override
public
RoadProperty
generateProperty
(
Location
pLocation
,
RoadNetworkEdge
pEdge
)
{
return
new
TrafficSignProperty
(
pLocation
,
pEdge
,
true
);
}
@Override
public
Class
<?
extends
RoadProperty
>
getGenerateClass
()
{
return
TrafficSignProperty
.
class
;
}
}
Prev
1
2
Next
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