-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsim_types.h
32 lines (24 loc) · 804 Bytes
/
sim_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef SIM_TYPES
#define SIM_TYPES
// Any object that participates in a simulation by receiving timestep updates
// so it can update its internal state.
class SimulationAgent
{
public:
// called as an initialization befomre any timestep updates
virtual void begin() = 0;
// called for each timestep and agen updates its state
virtual void timestepUpdate(size_t prev_time, size_t cur_time) = 0;
};
// A device that can be charged at a charging station.
class ChargeableDevice
{
public:
// adds charge to the device in units of kWh
virtual void addCharge(double kWh) = 0;
// the kWh per millisecond that the device can receive charge
virtual double chargeRate() = 0;
// returns true if device is fully charged, false otherwise
virtual bool hasFullCharge() = 0;
};
#endif // SIM_TYPES