for (int i = 0; i < rowCount; i++) {
CircuitState circuitState = new CircuitState(proj, circuit);
for (int j = 0; j < inputCount; j++) {
Instance pin = inputPins.get(j);
InstanceState pinState = circuitState.getInstanceState(pin);
boolean value = TruthTable.isInputSet(i, j, inputCount);
Pin.FACTORY.setValue(pinState, value ? Value.TRUE : Value.FALSE);
}
Propagator prop = circuitState.getPropagator();
prop.propagate();
/* TODO for the SimulatorPrototype class
do {
prop.step();
} while (prop.isPending()); */
// TODO: Search for circuit state
if (prop.isOscillating()) {
for (int j = 0; j < columns.length; j++) {
columns[j][i] = Entry.OSCILLATE_ERROR;
}
} else {
for (int j = 0; j < columns.length; j++) {
Instance pin = outputPins.get(j);
InstanceState pinState = circuitState.getInstanceState(pin);
Entry out;
Value outValue = Pin.FACTORY.getValue(pinState).get(0);
if (outValue == Value.TRUE) out = Entry.ONE;
else if (outValue == Value.FALSE) out = Entry.ZERO;
else if (outValue == Value.ERROR) out = Entry.BUS_ERROR;