implement print() and fix simulate()

This commit is contained in:
Joel Beckmeyer 2017-04-24 20:24:39 -04:00
parent c4c62ed53b
commit 081330103c
1 changed files with 5 additions and 1 deletions

View File

@ -127,7 +127,7 @@ void Simulation::simulate() {
int index = 0;
do{
tmpGate = output->getGate(index++);
tmpGate->evaluate(tmpEvent.evTime);
e.push(tmpGate->evaluate(tmpEvent.evTime));
}while(tmpGate != nullptr);
}
}
@ -135,6 +135,10 @@ void Simulation::simulate() {
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)