@Override
protected void doRun() {
if (rowKeyContaintsSourcesOfRelation){
for (Entry<Element, LinkedHashMap<Element, Float>> columnEntry : ratingsMatrix.getColumnEntrySet()){
Element sourceElement = columnEntry.getKey();
for (Entry<Element, Float> entry: columnEntry.getValue().entrySet() ){
// key = target Element
// value = weight
cacheManager.createRatingRelation(sourceElement, entry.getKey(), entry.getValue());
}
}
}
else {
for (Entry<Element, LinkedHashMap<Element, Float>> columnEntry : ratingsMatrix.getColumnEntrySet()){
Element targetElement = columnEntry.getKey();
for (Entry<Element, Float> entry: columnEntry.getValue().entrySet() ){
// key = target Element
// value = weight
cacheManager.createRatingRelation(entry.getKey(), targetElement, entry.getValue());
}