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
de715009
Commit
de715009
authored
Apr 30, 2018
by
Tobias Meuser
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
First really working version for adhoc
parent
ae21935b
Changes
6
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/vehicular/caching/DefaultCachingComponent.java
View file @
de715009
...
...
@@ -40,6 +40,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.Avai
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.JamInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.RoadInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetwork
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute
;
...
...
@@ -88,6 +89,7 @@ implements CachingComponent, ConnectivityListener {
for
(
T
t
:
cacheEntries
)
{
Object
position
=
getEdgeOrPosition
(
t
);
if
(!
similarCacheEntries
.
containsKey
(
position
))
{
similarCacheEntries
.
put
(
position
,
new
ArrayList
<>());
}
...
...
src/de/tud/kom/p2psim/impl/vehicular/caching/decision/AveragingCacheDecisionStrategy.java
View file @
de715009
...
...
@@ -23,7 +23,7 @@ package de.tud.kom.p2psim.impl.vehicular.caching.decision;
import
java.util.List
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.NumericVectoralProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.VectoralJamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.
jam.
VectoralJamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.caching.decision.CacheDecisionStrategy
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.RoadInformation
;
...
...
src/de/tud/kom/p2psim/impl/vehicular/caching/decision/MajorityVotingVectoralCacheDecisionStrategy.java
View file @
de715009
...
...
@@ -23,8 +23,8 @@ package de.tud.kom.p2psim.impl.vehicular.caching.decision;
import
java.util.List
;
import
de.tudarmstadt.maki.simonstrator.api.Time
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.TemporalDependencyMatrix
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.VectoralProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.vector.TemporalDependencyMatrix
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.caching.decision.CacheDecisionStrategy
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.AvailableInformationAttributes
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation
;
...
...
src/de/tud/kom/p2psim/impl/vehicular/caching/decision/OptimalCacheDecisionStrategy.java
View file @
de715009
...
...
@@ -22,12 +22,12 @@ package de.tud.kom.p2psim.impl.vehicular.caching.decision;
import
java.util.List
;
import
de.tudarmstadt.maki.simonstrator.api.
component.sensor.environment.data.JamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.
Time
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.VectoralProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.jam.JamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.caching.decision.CacheDecisionStrategy
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.AvailableInformationAttributes
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.RoadInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
public
class
OptimalCacheDecisionStrategy
implements
CacheDecisionStrategy
{
...
...
@@ -46,11 +46,7 @@ public class OptimalCacheDecisionStrategy implements CacheDecisionStrategy {
RoadNetworkEdge
edge
=
(
RoadNetworkEdge
)
pSimilarPointInformation
.
get
(
0
).
getAttribute
(
AvailableInformationAttributes
.
EDGE
);
double
actualSpeed
=
edge
.
getCurrentSpeedState
();
if
(
actualSpeed
==
24
d
)
{
System
.
out
.
println
();
}
double
actualSpeed
=
edge
.
getCurrentSpeed
();
JamProperty
jamProperty
=
edge
.
getJamProperty
();
...
...
@@ -61,6 +57,7 @@ public class OptimalCacheDecisionStrategy implements CacheDecisionStrategy {
maxTimestamp
=
-
1
;
}
double
difference
=
Double
.
MAX_VALUE
;
T
maxFitting
=
null
;
for
(
T
t
:
pSimilarPointInformation
)
{
long
timestamp
=
t
.
getDetectionDate
();
...
...
@@ -69,9 +66,15 @@ public class OptimalCacheDecisionStrategy implements CacheDecisionStrategy {
if
(
currentValue
instanceof
VectoralProperty
)
{
currentValue
=
((
VectoralProperty
)
currentValue
).
getMostProbableValue
();
}
if
(
currentValue
.
equals
(
actualSpeed
)
&&
timestamp
>
maxTimestamp
)
{
maxTimestamp
=
timestamp
;
if
(
timestamp
>=
maxTimestamp
)
{
if
(
currentValue
.
equals
(
actualSpeed
))
{
maxFitting
=
t
;
difference
=
0
;
}
else
if
(
currentValue
instanceof
Number
&&
Math
.
abs
(((
Number
)
currentValue
).
doubleValue
()
-
actualSpeed
)
<
difference
)
{
maxFitting
=
t
;
difference
=
Math
.
abs
(((
Number
)
currentValue
).
doubleValue
()
-
actualSpeed
);
}
}
}
...
...
@@ -81,7 +84,7 @@ public class OptimalCacheDecisionStrategy implements CacheDecisionStrategy {
for
(
T
t
:
pSimilarPointInformation
)
{
long
timestamp
=
t
.
getDetectionDate
();
if
(
timestamp
>
maxTimestamp
)
{
if
(
timestamp
>
=
maxTimestamp
)
{
maxTimestamp
=
timestamp
;
maxFitting
=
t
;
}
...
...
src/de/tud/kom/p2psim/impl/vehicular/caching/decision/TTLbasedCacheDecisionStrategy.java
View file @
de715009
...
...
@@ -27,14 +27,15 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
cern.colt.Arrays
;
import
de.tudarmstadt.maki.simonstrator.api.Time
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.VectoralJamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.VectoralProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.jam.VectoralJamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.caching.decision.CacheDecisionStrategy
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.AvailableInformationAttributes
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.RoadInformation
;
import
edu.emory.mathcs.backport.java.util.Arrays
;
public
class
TTLbasedCacheDecisionStrategy
implements
CacheDecisionStrategy
{
private
static
final
long
SCALING
=
Time
.
SECOND
;
...
...
@@ -117,10 +118,6 @@ public class TTLbasedCacheDecisionStrategy implements CacheDecisionStrategy {
}
if
(
differentValue
)
{
if
(
Time
.
getCurrentTime
()
==
463500000
)
{
System
.
out
.
println
();
}
long
difference
=
maxTimestamp
-
minTimestamp
;
if
(
difference
==
0
)
{
...
...
@@ -176,8 +173,8 @@ public class TTLbasedCacheDecisionStrategy implements CacheDecisionStrategy {
long
timestamp
=
t
.
getDetectionDate
();
Object
currentValue
=
t
.
getValue
();
if
(
currentValue
instanceof
Vectoral
Jam
Property
)
{
currentValue
=
((
Vectoral
Jam
Property
)
currentValue
).
getMostProbableValue
();
if
(
currentValue
instanceof
VectoralProperty
)
{
currentValue
=
((
VectoralProperty
)
currentValue
).
getMostProbableValue
();
}
if
(
currentValue
.
equals
(
maxValue
)
&&
timestamp
>
maxTimestamp
)
{
...
...
@@ -186,6 +183,26 @@ public class TTLbasedCacheDecisionStrategy implements CacheDecisionStrategy {
}
}
if
(
maxFitting
.
getValue
()
instanceof
VectoralProperty
)
{
VectoralProperty
vectoralProperty
=
((
VectoralProperty
)
maxFitting
.
getValue
()).
clone
();
double
[]
valueProbabilities
=
vectoralProperty
.
getValueProbabilities
();
Arrays
.
fill
(
valueProbabilities
,
0
);
double
sum
=
0
;
for
(
Object
key
:
weight
.
keySet
())
{
valueProbabilities
[
vectoralProperty
.
getIndexForValue
(
key
)]
=
weight
.
get
(
key
);
sum
+=
weight
.
get
(
key
);
}
for
(
int
i
=
0
;
i
<
valueProbabilities
.
length
;
i
++)
{
valueProbabilities
[
i
]
/=
sum
;
}
RoadInformation
roadInformation
=
new
RoadInformation
(
vectoralProperty
);
roadInformation
.
copyAttributes
((
RoadInformation
)
maxFitting
);
maxFitting
=
(
T
)
roadInformation
;
}
_lastDecision
=
maxFitting
.
getValue
();
return
maxFitting
;
...
...
src/de/tud/kom/p2psim/impl/vehicular/caching/decision/TTLbasedVectoralCacheDecisionStrategy.java
View file @
de715009
...
...
@@ -21,15 +21,16 @@
package
de.tud.kom.p2psim.impl.vehicular.caching.decision
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
de.tudarmstadt.maki.simonstrator.api.Time
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.
VectoralJamProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.
TemporalDependencyMatrix
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.VectoralProperty
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.
vector.TemporalDependencyMatrix
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.
measurement.MeasurementDistributionTypeContainer
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.caching.decision.CacheDecisionStrategy
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.AvailableInformationAttributes
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation
;
...
...
@@ -100,11 +101,11 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
long
maxTimestamp
=
0
;
Object
value
=
pSimilarPointInformation
.
get
(
0
).
getValue
();
if
(
value
instanceof
VectoralProperty
)
{
value
=
((
VectoralProperty
)
value
).
getMostProbable
Value
();
value
=
((
VectoralProperty
)
value
).
getMostProbable
Index
();
}
boolean
differentValue
=
false
;
List
<
Double
>
possibleValues
=
new
ArrayList
<>();
List
<
Integer
>
possibleValues
=
new
ArrayList
<>();
for
(
T
t
:
pSimilarPointInformation
)
{
if
(!
t
.
hasAttribute
(
AvailableInformationAttributes
.
TTL
))
{
...
...
@@ -122,13 +123,16 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
Object
currentValue
=
t
.
getValue
();
if
(
currentValue
instanceof
VectoralProperty
)
{
VectoralProperty
currentProperty
=
(
VectoralProperty
)
currentValue
;
currentValue
=
currentProperty
.
getMostProbableValue
();
currentValue
=
currentProperty
.
getMostProbableIndex
();
if
(!
value
.
equals
(
currentValue
))
{
differentValue
=
true
;
}
if
(!
possibleValues
.
contains
(
currentValue
))
{
possibleValues
.
add
((
Double
)
currentValue
);
for
(
int
i
=
0
;
i
<
currentProperty
.
getValueProbabilities
().
length
;
i
++)
{
if
(!
possibleValues
.
contains
(
i
))
{
possibleValues
.
add
(
i
);
}
}
}
}
...
...
@@ -143,26 +147,33 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
double
rate
=
difference
/
((
double
)
(
pSimilarPointInformation
.
size
()
-
1
)
*
SCALING
);
long
ttl
=
getTTL
(
pSimilarPointInformation
.
get
(
0
));
double
numberOfMessages
=
ttl
/
rate
;
double
numberOfMessages
=
ttl
/
rate
+
1
;
VectoralProperty
currentProperty
=
null
;
double
b
=
0
;
int
count
=
0
;
for
(
Double
possibleValue
:
possibleValues
)
{
double
temp
=
determineB
(((
RoadInformation
)
pSimilarPointInformation
.
get
(
0
)).
getEdge
(),
possibleValue
,
getChangeRate
(
pSimilarPointInformation
.
get
(
0
),
rate
),
rate
,
1
-
accuracy
,
numberOfMessages
,
costWrongKeep
,
costWrongChange
);
List
<
Double
>
bValues
=
new
ArrayList
<>();
double
b
;
for
(
Integer
possibleValue
:
possibleValues
)
{
double
temp
=
determineB
((
VectoralProperty
)
pSimilarPointInformation
.
get
(
0
).
getValue
(),
((
RoadInformation
)
pSimilarPointInformation
.
get
(
0
)).
getEdge
(),
possibleValue
,
getChangeRate
(
pSimilarPointInformation
.
get
(
0
),
rate
),
rate
,
1
-
accuracy
,
numberOfMessages
,
costWrongKeep
,
costWrongChange
);
if
(!
Double
.
isNaN
(
temp
))
{
b
+=
temp
;
count
++;
bValues
.
add
(
temp
);
}
}
if
(
count
>
0
)
{
b
/=
count
;
Collections
.
sort
(
bValues
);
if
(
bValues
.
size
()
>
0
)
{
if
(
bValues
.
size
()
%
2
==
0
)
{
b
=
(
bValues
.
get
(
bValues
.
size
()
/
2
)
+
bValues
.
get
(
bValues
.
size
()
/
2
-
1
))
/
2.0
;
}
else
{
b
=
bValues
.
get
(
bValues
.
size
()
/
2
);
}
}
else
{
b
=
Double
.
NEGATIVE_INFINITY
;
}
int
count
=
0
;
for
(
T
t
:
pSimilarPointInformation
)
{
RoadInformation
roadInformation
=
((
RoadInformation
)
t
);
VectoralProperty
property
=
(
VectoralProperty
)
roadInformation
.
getValue
();
...
...
@@ -214,12 +225,12 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
* @return
*/
private
<
T
extends
PointInformation
>
double
getAccuracy
(
T
pT
)
{
if
(
pT
instanceof
RoadInformation
)
{
RoadInformation
roadInformation
=
((
RoadInformation
)
pT
);
VectoralProperty
property
=
(
VectoralProperty
)
roadInformation
.
getValue
();
double
accuracy
=
property
.
getProbabilityFor
Value
(
property
.
getMostProbable
Value
());
return
accuracy
;
}
//
if (pT instanceof RoadInformation) {
//
RoadInformation roadInformation = ((RoadInformation) pT);
//
VectoralProperty property = (VectoralProperty) roadInformation.getValue();
//
double accuracy = property.getProbabilityFor
Index
(property.getMostProbable
Index
());
//
return accuracy;
//
}
return
this
.
accuracy
;
}
...
...
@@ -296,17 +307,17 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
return
(
int
)
Math
.
round
(
Math
.
log
(-
changeProbability
/
Math
.
log
(
errorProbability
)
*
costSlow
/
costFast
)
/
Math
.
log
(
errorProbability
));
}
public
double
determineB
(
RoadNetworkEdge
pRoadNetworkEdge
,
double
pPossibleValue
,
double
change
,
double
rate
,
double
errorProbability
,
double
pNumberOfMessages
,
double
costSlow
,
double
costFast
)
{
public
double
determineB
(
VectoralProperty
pTemplate
,
RoadNetworkEdge
pRoadNetworkEdge
,
int
pPossibleValue
,
double
change
,
double
rate
,
double
errorProbability
,
double
pNumberOfMessages
,
double
costSlow
,
double
costFast
)
{
if
(
errorProbability
==
0
||
errorProbability
==
1
||
errorProbability
==
0.5
)
{
return
Double
.
NaN
;
}
if
(
_lastDecision
!=
null
)
{
if
(
pPossibleValue
==
((
Vectoral
Jam
Property
)
_lastDecision
).
getMostProbable
Value
())
{
if
(
pPossibleValue
==
((
VectoralProperty
)
_lastDecision
).
getMostProbable
Index
())
{
return
Double
.
NaN
;
}
}
else
{
if
(
pPossibleValue
==
p
RoadNetworkEdge
.
getCurrentSpeedState
())
{
if
(
pPossibleValue
==
p
Template
.
getDefaultIndex
())
{
return
Double
.
NaN
;
}
}
...
...
@@ -316,6 +327,10 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
int
optimalAmount
=
getOptimalMessageAmountForSwitch
(
p_c
,
errorProbability
,
costSlow
,
costFast
);
if
((
int
)
pNumberOfMessages
<=
optimalAmount
)
{
return
Double
.
POSITIVE_INFINITY
;
}
if
(
optimalAmount
==
1
)
{
return
Double
.
NEGATIVE_INFINITY
;
}
...
...
@@ -331,15 +346,15 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
}
do
{
Vectoral
Jam
Property
valueAfterN
=
calculateMostProbable
Value
(
pRoadNetworkEdge
,
pPossibleValue
,
optimalAmount
,
rate
,
errorProbability
,
pNumberOfMessages
,
b
);
VectoralProperty
valueAfterN
=
calculateMostProbable
(
pTemplate
,
pRoadNetworkEdge
,
pPossibleValue
,
optimalAmount
,
rate
,
errorProbability
,
pNumberOfMessages
,
b
);
double
probableValueAfterN
=
Double
.
NaN
;
if
(
valueAfterN
!=
null
)
{
probableValueAfterN
=
valueAfterN
.
getMostProbable
Value
();
probableValueAfterN
=
valueAfterN
.
getMostProbable
Index
();
}
Vectoral
Jam
Property
valueBeforeN
=
calculateMostProbable
Value
(
pRoadNetworkEdge
,
pPossibleValue
,
optimalAmount
-
1
,
rate
,
errorProbability
,
pNumberOfMessages
,
b
);
VectoralProperty
valueBeforeN
=
calculateMostProbable
(
pTemplate
,
pRoadNetworkEdge
,
pPossibleValue
,
optimalAmount
-
1
,
rate
,
errorProbability
,
pNumberOfMessages
,
b
);
double
probableValueBeforeN
=
Double
.
NaN
;
if
(
valueBeforeN
!=
null
)
{
probableValueBeforeN
=
valueBeforeN
.
getMostProbable
Value
();
probableValueBeforeN
=
valueBeforeN
.
getMostProbable
Index
();
}
if
(
probableValueAfterN
==
pPossibleValue
&&
probableValueAfterN
!=
probableValueBeforeN
)
{
...
...
@@ -378,16 +393,16 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
}
while
(
true
);
}
public
Vectoral
Jam
Property
calculateMostProbable
Value
(
RoadNetworkEdge
pRoadNetworkEdge
,
double
pNewValue
,
int
optimalMessageAmount
,
double
rate
,
double
errorProbability
,
double
pNumberOfMessages
,
double
b
)
{
Vectoral
Jam
Property
currentProperty
=
null
;
public
VectoralProperty
calculateMostProbable
(
VectoralProperty
pTemplate
,
RoadNetworkEdge
pRoadNetworkEdge
,
int
pNewValue
,
int
optimalMessageAmount
,
double
rate
,
double
errorProbability
,
double
pNumberOfMessages
,
double
b
)
{
VectoralProperty
currentProperty
=
null
;
for
(
int
a
=
optimalMessageAmount
+
1
;
a
<=
pNumberOfMessages
;
a
++)
{
Vectoral
Jam
Property
jamProperty
=
new
VectoralJamProperty
();
VectoralProperty
jamProperty
=
pTemplate
.
clone
();
if
(
_lastDecision
!=
null
)
{
jamProperty
.
set
GaussianSpeedWithAccuracy
(((
Vectoral
Jam
Property
)
_lastDecision
).
getMostProbable
Value
(),
accuracy
);
jamProperty
.
set
(((
VectoralProperty
)
_lastDecision
).
getMostProbable
Index
(),
accuracy
,
MeasurementDistributionTypeContainer
.
getDistribution
(
pTemplate
.
getClass
())
);
}
else
{
jamProperty
.
set
GaussianSpeedWithAccuracy
(
pRoadNetworkEdge
.
getCurrentSpeedState
(),
accuracy
);
jamProperty
.
set
(
pTemplate
.
getDefaultIndex
(),
accuracy
,
MeasurementDistributionTypeContainer
.
getDistribution
(
pTemplate
.
getClass
())
);
}
TemporalDependencyMatrix
temporalDependencyMatrix
=
jamProperty
.
getDependencyMatrix
();
temporalDependencyMatrix
=
temporalDependencyMatrix
.
age
((
long
)
(
a
*
rate
));
...
...
@@ -398,18 +413,18 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
}
temporalDependencyMatrix
=
modifyDependencyMatrix
(
temporalDependencyMatrix
,
impact
);
jamProperty
=
(
Vectoral
Jam
Property
)
jamProperty
.
age
(
1
,
temporalDependencyMatrix
);
jamProperty
=
(
VectoralProperty
)
jamProperty
.
age
(
1
,
temporalDependencyMatrix
);
if
(
currentProperty
!=
null
)
{
currentProperty
=
(
Vectoral
Jam
Property
)
currentProperty
.
combine
(
jamProperty
);
currentProperty
=
(
VectoralProperty
)
currentProperty
.
combine
(
jamProperty
);
}
else
{
currentProperty
=
jamProperty
;
}
}
for
(
int
a
=
0
;
a
<=
optimalMessageAmount
;
a
++)
{
Vectoral
Jam
Property
jamProperty
=
new
VectoralJamProperty
();
jamProperty
.
setGaussian
Speed
WithAccuracy
(
pNewValue
,
accuracy
);
VectoralProperty
jamProperty
=
pTemplate
.
clone
();
jamProperty
.
setGaussianWithAccuracy
(
pNewValue
,
accuracy
);
TemporalDependencyMatrix
temporalDependencyMatrix
=
jamProperty
.
getDependencyMatrix
();
temporalDependencyMatrix
=
temporalDependencyMatrix
.
age
((
long
)
(
a
*
rate
));
...
...
@@ -420,10 +435,10 @@ public class TTLbasedVectoralCacheDecisionStrategy implements CacheDecisionStrat
}
temporalDependencyMatrix
=
modifyDependencyMatrix
(
temporalDependencyMatrix
,
impact
);
jamProperty
=
(
Vectoral
Jam
Property
)
jamProperty
.
age
(
1
,
temporalDependencyMatrix
);
jamProperty
=
(
VectoralProperty
)
jamProperty
.
age
(
1
,
temporalDependencyMatrix
);
if
(
currentProperty
!=
null
)
{
currentProperty
=
(
Vectoral
Jam
Property
)
currentProperty
.
combine
(
jamProperty
);
currentProperty
=
(
VectoralProperty
)
currentProperty
.
combine
(
jamProperty
);
}
else
{
currentProperty
=
jamProperty
;
}
...
...
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