public void setUp() {
this.gson = new Gson();
}
public void test_saveRegionObject() throws IOException {
Region LGNRegion = new Region("LGN", 8, 8, 1, 50, 3);
Retina retina = new Retina(66, 66);
AbstractSensorCellsToRegionConnect retinaToLGN = new SensorCellsToRegionRectangleConnect();
retinaToLGN.connect(retina.getVisionCells(), LGNRegion, 0, 0);
// run spatial pooling on a image
SpatialPooler spatialPooler = new SpatialPooler(LGNRegion);
spatialPooler.setLearningState(true);
retina.seeBMPImage("2.bmp");
Set<Column> LGNNeuronActivity = spatialPooler
.performPooling();
assertEquals(11, LGNNeuronActivity.size());
Gson gson2 = new Gson();
Region trainedLGNRegion = spatialPooler.getRegion();
String regionObject = gson2.toJson(trainedLGNRegion);
JsonFileInputOutput.saveObjectToTextFile(regionObject,
"./src/test/java/model/util/test_saveRegionObject.txt");
}