EvolvingObjects
eoIntBounds Class Reference

Defines bound classes for real numbers. More...

#include <es/eoIntBounds.h>

Inheritance diagram for eoIntBounds:
eoPersistent eoPrintable eoGeneralIntBounds eoIntAboveBound eoIntBelowBound eoIntInterval eoIntNoBounds

List of all members.

Public Member Functions

virtual bool isBounded (void) const =0
 Self-Test: true if ***both*** a min and a max.
virtual bool hasNoBoundAtAll (void) const =0
 Self-Test: true if no min ***and*** no max hence no further need to test/truncate/fold anything.
virtual bool isMinBounded (void) const =0
 Self-Test: bounded from below???
virtual bool isMaxBounded (void) const =0
 Self-Test: bounded from above???
virtual bool isInBounds (double) const =0
 Test on a value: is it in bounds?
virtual void foldsInBounds (double &) const =0
 Put value back into bounds - by folding back and forth.
virtual void foldsInBounds (long int &i) const
 foldsInBounds for ints: call the method for double and convert back
virtual void truncate (double &) const =0
 Put value back into bounds - by truncating to a boundary value.
virtual void truncate (long int &i) const
 truncate for ints: call the method for double and convert back
virtual long int minimum () const =0
 get minimum value std::exception if does not exist
virtual long int maximum () const =0
 get maximum value std::exception if does not exist
virtual long int range () const =0
 get range std::exception if unbounded
virtual double uniform (eoRng &_rng=eo::rng) const =0
 random generator of uniform numbers in bounds uses same naming convention than eo::rng std::exception if unbounded
virtual long int random (eoRng &_rng=eo::rng) const =0
virtual eoIntBoundsdup () const =0
 for memory managements - ugly

Detailed Description

Defines bound classes for real numbers.

Scalar type: ------------ Basic class is eoIntBounds, a pure virtual.

The following pure virtual methods are to be used in mutations:

  • void foldsInBounds(long int &) that folds any value that falls out of the bounds back into the bounds, by bouncing on the limit (if any)
  • bool isInBounds(long int) that simply says whether or not the argument is in the bounds
  • void truncate(long int &) that set the argument to the bound value it it exceeds it

So mutation can choose

  • iterate trying until they fall in bounds,
  • only try once and "restd::pair" by using the foldsInBounds method
  • only try once and restd::pair using the truncate method (will create a huge bias toward the bound if the soluiton is not far from the bounds)

There is also a uniform() method that generates a uniform value (if possible, i.e. if bounded) in the interval.

Derived class are eoIntInterval that holds a minimum and maximum value, eoIntNoBounds the "unbounded bounds" (-infinity, +infinity) eoIntBelowBound the half-bounded interval [min, +infinity) eoIntAboveBound the half-bounded interval (-infinity, max]

THis file also contains the declaration of *the* global object that is the unbounded bound

Definition at line 70 of file eoIntBounds.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends