restructure and add ipi texs

This commit is contained in:
2019-11-06 18:24:04 +01:00
parent e21da561fc
commit 8fd8d2a485
155 changed files with 129 additions and 0 deletions
@@ -0,0 +1,37 @@
// Simulator, Singleton
class Simulator {
public:
// Konstruktor
Simulator ();
// aktuelle Zeit auslesen
int GetTime ();
// (B): Draht w wird zur Zeit t in Zustand s wechseln
void StoreWireEvent (Wire& w, int t, State s);
// (D): Baustein c soll zur aktuellen Zeit neu berechnet werden
void StoreCircuitEvent (Circuit& c);
// Starte Simulation bei Zeit 0
void Simulate (int end);
private:
struct WireEvent { // Eine lokale Struktur
WireEvent (); // fuer Ereignis "Zustandswechsel"
WireEvent (Wire& W, int T, State S);
Wire* w;
int t;
State s;
bool operator< (WireEvent we);
void print (std::ostream& stm) {stm << "(WE: " << t << " " << w << " " << s << std::endl; }
} ;
int time;
MinPriorityQueue<WireEvent> pq; // Fuer (B)-Ereignisse
Queue<Circuit*> q; // Fuer (D)-Ereignisse
} ;
// Globale Variable vom Typ Simulator (Singleton).
// Wird von allen Bausteinen und Draehten benutzt!
Simulator Sim;