This is simple example for basic testing of SIMLIB/C++.
This is simple example for basic testing of SIMLIB/C++.
Usage: make test
#define SIMLIB_DEBUG
#define I_REALLY_KNOW_HOW_TO_USE_WAITUNTIL
};
public:
WaitUntil(Time>3);
WaitUntil(true);
}
};
}
Print(
"Model _TEST_ --- test model for SIMLIB/C++ \n");
Print(
"# end of test t=%g\n", Time);
return 0;
}
TestProcess globalprocess
void Behavior() override
behavior description
virtual void Wait(double dtime)
wait for dtime interval
virtual void Activate(double t) override
activate at time t (schedule)
Process(Priority_t p=DEFAULT_PRIORITY)
Process constructor sets state to PREPARED.
virtual double Value()=0
get block output value this method should be defined in classes derived from aContiBlock
void Activate(Entity *e)
activate entity e
aContiBlock & T
simulation time block reference
void SetAccuracy(double _abserr, double _relerr)
set max.
void SetStep(double _dtmin, double _dtmax)
Set integration step interval.
void Run()
run simulation experiment
int Print(const char *fmt,...)
for Output methods, can be redirected
void Init(double t0, double t1=SIMLIB_MAXTIME)
Initialize simulator and model time.
Main SIMLIB/C++ interface.