}
}
}
public void bload(String filepath) {
Input input = null;
try {
input = new Input(new FileInputStream(filepath));
SerializerHelper serializerHelper = helper.get();
Basis base = serializerHelper.readB(input);
Map<String, VectorSet> vecSets = serializerHelper.readVectorSets(input, base);
Map<String, Recommendation> recs = serializerHelper.readRecommendations(input, vecSets);
this.base = base;
this.vectorSets = vecSets;
this.recommendations = recs;
for (String vkey : vecSets.keySet()) {
for (SimBasisListener listener : listeners) {
listener.onVecSetAdded(key(), vkey);
}
}
for (String key : recs.keySet()) {
Recommendation rec = recs.get(key);
String vkeySrc = rec.source.key();
String vkeyTgt = rec.target.key();
for (SimBasisListener listener : listeners) {
listener.onRecAdded(key(), vkeySrc, vkeyTgt);
}
}
} catch (Throwable e) {
throw new SimException(e);
} finally {
if (input != null) {
input.close();
}
}
}