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
1eff65ac
Commit
1eff65ac
authored
May 02, 2018
by
Tobias Meuser
Browse files
Fixed bug to enable CorrectInformationRatio metric
parent
27422176
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/vehicular/caching/DefaultCachingComponent.java
View file @
1eff65ac
...
...
@@ -82,23 +82,28 @@ implements CachingComponent, ConnectivityListener {
return
null
;
}
Map
<
Object
,
List
<
PointInformation
>>
similarCacheEntries
=
new
HashMap
<>();
Map
<
Object
,
Map
<
Class
<?
extends
Object
>,
List
<
PointInformation
>>
>
similarCacheEntries
=
new
HashMap
<>();
for
(
T
t
:
cacheEntries
)
{
Object
position
=
getEdgeOrPosition
(
t
);
if
(!
similarCacheEntries
.
containsKey
(
position
))
{
similarCacheEntries
.
put
(
position
,
new
ArrayList
<>());
similarCacheEntries
.
put
(
position
,
new
HashMap
<>());
}
similarCacheEntries
.
get
(
position
).
add
(
t
);
if
(!
similarCacheEntries
.
get
(
position
).
containsKey
(
t
.
getValue
().
getClass
()))
{
similarCacheEntries
.
get
(
position
).
put
(
t
.
getValue
().
getClass
(),
new
ArrayList
<
PointInformation
>());
}
similarCacheEntries
.
get
(
position
).
get
(
t
.
getValue
().
getClass
()).
add
(
t
);
}
List
<
T
>
decidedInformation
=
new
ArrayList
<>();
for
(
List
<
PointInformation
>
similarE
ntri
es
:
similarCacheEntries
for
(
Map
<
Class
<?
extends
Object
>,
List
<
PointInformation
>
>
similarE
dg
es
:
similarCacheEntries
.
values
())
{
PointInformation
correctInformation
=
_decisionStrategy
.
decideOnCorrectInformation
(
similarEntries
);
decidedInformation
.
add
((
T
)
correctInformation
);
for
(
List
<
PointInformation
>
similarInformation
:
similarEdges
.
values
())
{
PointInformation
correctInformation
=
_decisionStrategy
.
decideOnCorrectInformation
(
similarInformation
);
decidedInformation
.
add
((
T
)
correctInformation
);
}
}
return
decidedInformation
;
...
...
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