Package transsys :: Module optim :: Class FitnessResult
[hide private]
[frames] | no frames]

Class FitnessResult

source code

object --+
         |
        FitnessResult

Base class for results of objective (or fitness) functions.

Calling objective functions (subclasses of AbstractObjectiveFunction) should return instances of this class or one of its subclasses. Optimisers use the fitness instance variable. Subclasses may introduce further instance variables to describe the result achieved, break it down to individual components of the transsys program etc.

Instance Methods [hide private]
 
__init__(self, fitness)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
getTranssysProgramComments(self)
Get a list of strings describing the objective value and its computation.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Instance Variables [hide private]
  fitness
the fitness value, i.e. the value computed by the objective function.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, fitness)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

getTranssysProgramComments(self)

source code 

Get a list of strings describing the objective value and its computation.

The idea is to attach this list to the comments of the transsys program that has been evaluated.

Notice that since the FitnessResult does not keep track of the transsys program it pertains to, so it's up to the user of this method to make sure the comments are added to the correct transsys program.