//RegisterClusterLocation(): method called while constructing a cluster to //link an mlb to each of its neighbors in the cluster. This will greatly facilitate //the implementation of the intercluster bus, since each mlb will simply know what its neighbors are public void RegisterClusterLocation(MLB mlbPlus1, MLB mlbPlus2, MLB mlbPlus3, int mlbClusterIndex) { this.mlbPlus1 = mlbPlus1; this.mlbPlus2 = mlbPlus2; this.mlbPlus3 = mlbPlus3; this.mlbClusterIndex = mlbClusterIndex; }
// Create Cluster(): Creates a cluster by instantiating the mlbs and linking them together. Note that //They links are addressed using modulo to allow the neighbor relationships to wrap around (As suggested in the ISA) public void CreateCluster() { for (int i = 0; i < 4; i++) { mlbs[i] = new MLB(); mlbs[i].RegisterClusterLocation(mlbs[(i + 1) % 4], mlbs[(i + 2) % 4], mlbs[(i + 3) % 4], i); //links each mlb to each of the other mlbs } Instruction inst = new Instruction(); }