33 enum PatternType {FIXED_PATTERN, VARIABLE_PATTERN};
36 Pattern(std::string name_,
int type_);
40 static Pattern* factory(
int type_, std::string name_,
MemPool* memPool);
43 void setTimeInterval(
int t) {
interval = t; }
44 void addFactor(
double f) {
factors.push_back(f); }
45 int timeInterval() {
return interval; }
46 int size() {
return factors.size(); }
47 double factor(
int i) {
return factors[i]; }
48 double currentFactor();
49 virtual void init(
int interval,
int tstart) = 0;
50 virtual int nextTime(
int t) = 0;
51 virtual void advance(
int t) = 0;
102 void addTime(
int t) { times.push_back(t); }
103 int time(
int i) {
return times[i]; }
104 void init(
int interval,
int tstart);
109 std::vector<int> times;
Abstract parent class for all pipe network components.
Definition: element.h:19
Describes the Element class.
A Pattern where factors change at varying time intervals.
Definition: pattern.h:93
A Pattern where factors change at fixed time intervals.
Definition: pattern.h:69
A simple pooled memory allocator.
Definition: mempool.h:21
int interval
fixed time interval (sec)
Definition: pattern.h:59
int currentIndex
index of current pattern interval
Definition: pattern.h:58
int type
type of time pattern
Definition: pattern.h:54
std::vector< double > factors
sequence of multiplier factors
Definition: pattern.h:57
A set of multiplier factors associated with points in time.
Definition: pattern.h:29