コード例 #1
0
 public void getInitialCentroidsFromFuzzyCentroidsDB() {
   String[] serilizedCentroids = CCentroidsDatabase.getSerializedClusterMap();
   for (int i = 0; i < serilizedCentroids.length; i++) {
     try {
       vectors.put(
           i,
           Storm.Databases.Functions.SerializeAndDeserializeJavaObjects
               .deserializeJavaDoublesVector(serilizedCentroids[i]));
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
 }
コード例 #2
0
 public void updateDB(int index, double[] vectorForUpdate) {
   String serializedVectors =
       Storm.Databases.Functions.SerializeAndDeserializeJavaObjects.serializeJavaDoublesVector(
           vectorForUpdate);
   CCentroidsDatabase.setSerializedMap(index, serializedVectors);
 }