implement print() and fix simulate()

This commit is contained in:
Joel Beckmeyer 2017-04-24 20:24:39 -04:00
parent c4c62ed53b
commit 081330103c

View File

@ -127,7 +127,7 @@ void Simulation::simulate() {
int index = 0; int index = 0;
do{ do{
tmpGate = output->getGate(index++); tmpGate = output->getGate(index++);
tmpGate->evaluate(tmpEvent.evTime); e.push(tmpGate->evaluate(tmpEvent.evTime));
}while(tmpGate != nullptr); }while(tmpGate != nullptr);
} }
} }
@ -135,6 +135,10 @@ void Simulation::simulate() {
void Simulation::print() void Simulation::print()
{ {
// iterate through wires, printing each of them
for(auto i = wires.begin(); i != wires.end(); ++i) {
cout << *i;
}
} }
Wire * Simulation::findWire(int n) Wire * Simulation::findWire(int n)