I have built a partial human brain model and the following is an example of how I use all the classes. I was wondering if anyone could critique my implementation strategies because I feel like the following setup is very clumsy. You can view all the code at: https://github.com/quinnliu/WalnutiQ
public class HowToUseMARK_I extends junit.framework.TestCase {
private NervousSystem nervousSystem;
private MemoryClassifier memoryClassifier_Digits;
private Gson gson;
public void setUp() throws IOException {
this.gson = new Gson();
this.nervousSystem = this.constructConnectedNervousSystem();
this.memoryClassifier_Digits = this.trainMemoryClassifierWithNervousSystem();
}
private NervousSystem constructConnectedNervousSystem() {
// construct Neocortex with just V1
Region rootRegionOfNeocortex = new Region("V1", 4, 4, 4, 50, 3);
RegionToRegionConnect neocortexConnectType = new RegionToRegionRectangleConnect();
Neocortex unconnectedNeocortex = new Neocortex(rootRegionOfNeocortex,
neocortexConnectType);
// construct LGN
Region LGNRegion = new Region("LGN", 8, 8, 1, 50, 3);
LateralGeniculateNucleus unconnectedLGN = new LateralGeniculateNucleus(
LGNRegion);
// construct Retina
VisionCell[][] visionCells = new VisionCell[65][65];
for (int x = 0; x < visionCells.length; x++) {
for (int y = 0; y < visionCells[0].length; y++) {
visionCells[x][y] = new VisionCell();
}
}
Retina unconnectedRetina = new Retina(visionCells);
// construct 1 object of NervousSystem to encapsulate all classes in
// MARK II
NervousSystem nervousSystem = new NervousSystem(unconnectedNeocortex,
unconnectedLGN, unconnectedRetina);
// connect Retina to LGN
Retina retina = nervousSystem.getPNS().getSNS().getRetina();
LateralGeniculateNucleus LGN = nervousSystem.getCNS().getBrain()
.getThalamus().getLGN();
SensorCellsToRegionConnect retinaToLGN = new SensorCellsToRegionRectangleConnect();
retinaToLGN.connect(retina.getVisionCells(), LGN.getRegion(), 0, 0);
// connect LGN to V1 Region of Neocortex
Neocortex neocortex = nervousSystem.getCNS().getBrain().getCerebrum()
.getCerebralCortex().getNeocortex();
RegionToRegionConnect LGNToV1 = new RegionToRegionRectangleConnect();
LGNToV1.connect(LGN.getRegion(), neocortex.getCurrentRegion(), 0, 0);
return nervousSystem;
}