40 #ifndef EGS_RUN_CONTROL_
41 #define EGS_RUN_CONTROL_
157 virtual int startSimulation();
169 return getNcase() - ndone;
182 virtual int finishSimulation();
190 virtual bool startBatch(
int,EGS_I64);
198 virtual bool finishBatch();
200 virtual void describeRCO();
201 virtual bool storeState(ostream &data);
202 virtual bool setState(istream &data);
203 virtual bool addState(istream &data);
204 virtual void resetCounter();
205 virtual bool getCombinedResult(
double &,
double &)
const {
209 virtual EGS_I64 getNdone()
const {
213 virtual void setNdone(EGS_I64 Ndone) {
217 virtual void incrementNdone() {
221 virtual EGS_Float getCPUTime()
const {
222 return cpu_time+previous_cpu_time;
234 int geomErrorCount, geomErrorMax;
256 EGS_Float previous_cpu_time;
260 class EGS_FileLocking;
285 void setNchunkForParallel(
int n) {
290 int startSimulation();
291 EGS_I64 getNextChunk();
292 int finishSimulation();
293 bool getCombinedResult(
double &,
double &)
const;
298 double tsum, tsum2, tcount, norm;
299 double last_sum, last_sum2, last_count;
300 unsigned long start_time;
312 bool createControlFile();
313 bool openControlFile();
314 bool closeControlFile();
315 bool lockControlFile();
316 bool unlockControlFile();
317 bool rewindControlFile();
318 bool readControlFile();
319 bool writeControlFile();
320 virtual bool writeControlString();
321 virtual bool readControlString();
376 int startSimulation();
386 int finishSimulation();
Base class for advanced EGSnrc C++ applications.
A 'job control file' (JCF) RCO.
A simple run control object for advanced EGSnrc C++ applications.
RCOType rco_type
RCO type to use.
@ uniform
parallel jobs with same numbe of histories
@ simple
single job or multiple independent jobs
void setNbatch(int n)
Set the number of batches to n.
void setMaxTime(EGS_Float t)
Set the maximum CPU time for the simulation to t.
virtual EGS_I64 getNextChunk()
Returns the number of histories to run in the next simulation chunk.
int getNchunk() const
Returns the number of simulation chunks.
void setRequiredUncertainty(EGS_Float a)
Set the required statistical uncertainty to a.
int getNbatch() const
Returns the number of batches per simulation chunk.
void setNcase(EGS_I64 n)
Set the number of particles to be simulated to n.
EGS_I64 getNcase() const
Returns the total number of particles to be simulated.
A simple class for measuring CPU time.
Defines the EGS_EXPORT and EGS_LOCAL macros.
#define EGS_EXPORT
Export symbols from the egspp library.
EGS_Timer class header file.