for (int i = 0; i < 3; i++)
if (bits[i] == Z)
return -1;
- // TODO maybe this is the wrong way around
return (bits[0] == ONE ? 4 : 0) + (bits[1] == ONE ? 2 : 0) + (bits[2] == ONE ? 1 : 0);
}
BitVector newHighLevelStateCasted = (BitVector) newHighLevelState;
if (newHighLevelStateCasted.length() != 12)
throw new IllegalArgumentException("Expected BitVector of length 12, not " + newHighLevelStateCasted.length());
- return ((BitVector[]) lastState)[addr] = newHighLevelStateCasted;
+ BitVector[] memC = (BitVector[]) lastState;
+ memC[addr] = newHighLevelStateCasted;
+ return memC;
}
return super.setHighLevelState(lastState, stateID, newHighLevelState);
}