Gadget
|
This is the class used to calculate the likelihood scores based on the bounds of the parameters for the current model. More...
#include <boundlikelihood.h>
Public Member Functions | |
BoundLikelihood (CommentStream &infile, const AreaClass *const Area, const TimeClass *const TimeInfo, const Keeper *const keeper, double weight, const char *name) | |
This is the default BoundLikelihood contructor. More... | |
virtual | ~BoundLikelihood () |
This is the default BoundLikelihood destructor. More... | |
void | Reset (const Keeper *const keeper) |
This function will reset the bounds information for the likelihood calculation. More... | |
virtual void | addLikelihood (const TimeClass *const TimeInfo) |
This function will calculate the likelihood score for the current model. More... | |
virtual void | printSummary (ofstream &outfile) |
This function will print summary information from the BoundLikelihood likelihood calculation. More... | |
virtual void | addLikelihoodKeeper (const TimeClass *const TimeInfo, Keeper *const keeper) |
This function will calculate the likelihood score for the current model after adjusting the parameters. More... | |
virtual void | Print (ofstream &outfile) const |
This function will print the summary MigrationPenalty likelihood information. More... | |
![]() | |
Likelihood (LikelihoodType T, double w, const char *givenname) | |
This is the default Likelihood constructor. More... | |
virtual | ~Likelihood () |
This is the default Likelihood destructor. More... | |
virtual void | Reset (const TimeClass *const TimeInfo) |
This function will reset the likelihood information. More... | |
virtual void | printLikelihood (ofstream &outfile, const TimeClass *const TimeInfo) |
This function will print information from each likelihood calculation. More... | |
double | getLikelihood () const |
This will return the weighted likelihood score for the likelihood component. More... | |
LikelihoodType | getType () const |
This will return the type of likelihood class. More... | |
double | getUnweightedLikelihood () const |
This will return the unweighted likelihood score for the likelihood component. More... | |
double | getWeight () const |
This will return the weight applied to the likelihood component. More... | |
virtual void | setFleetsAndStocks (FleetPtrVector &Fleets, StockPtrVector &Stocks) |
This will select the fleets and stocks required to calculate the likelihood score. More... | |
![]() | |
HasName () | |
This is the default HasName constructor. More... | |
virtual | ~HasName () |
This is the default HasName destructor. More... | |
HasName (const char *givenname) | |
This is the HasName constructor for a specified name. More... | |
const char * | getName () const |
This will return a null terminated text string containing the name of the object. More... | |
Protected Attributes | |
IntVector | switchnr |
This is the IntVector of the index of the parameters. More... | |
DoubleVector | upperbound |
This is the DoubleVector of the upper bounds. More... | |
DoubleVector | lowerbound |
This is the DoubleVector of the lower bounds. More... | |
DoubleVector | powers |
This is the DoubleVector of the power applied when the bound has been exceeded. More... | |
DoubleVector | lowerweights |
This is the DoubleVector of the weights applied when the lower bound has been exceeded. More... | |
DoubleVector | upperweights |
This is the DoubleVector of the weights applied when the upper bound has been exceeded. More... | |
DoubleVector | likelihoods |
This is the DoubleVector of the penalty applied when the bound has been exceeded. More... | |
ParameterVector | switches |
This is the ParameterVector of the names of the input parameters. More... | |
DoubleVector | values |
This is the DoubleVector used to temporarily store the values of the parameters. More... | |
double | defLW |
This is the default weight applied when the lower bound is exceeded. More... | |
double | defUW |
This is the default weight applied when the upper bound is exceeded. More... | |
double | defPower |
This is the default power applied when the bound is exceeded. More... | |
![]() | |
double | likelihood |
This stores the calculated score for the likelihood component. More... | |
double | weight |
This stores the weight to be applied to the likelihood component. More... | |
This is the class used to calculate the likelihood scores based on the bounds of the parameters for the current model.
This class calculates a penalty that is applied if any parameters go outside the specified bounds during the optimisation process. The Simulated Annealing algorithm restricts the parameters to be within the bounds, so this component will give a zero likelihood score when that algorithm is being used. The Hooke & Jeeves algorithm doesn't have this restriction, so a penalty is applied to any parameter that is beyond the bound, and the parameter is moved back to the bounds. A 'reasonable' model will have a zero likelihood score from this component.
BoundLikelihood::BoundLikelihood | ( | CommentStream & | infile, |
const AreaClass *const | Area, | ||
const TimeClass *const | TimeInfo, | ||
const Keeper *const | keeper, | ||
double | weight, | ||
const char * | name | ||
) |
This is the default BoundLikelihood contructor.
infile | is the CommentStream to read the likelihood parameters from |
Area | is the AreaClass for the current model |
TimeInfo | is the TimeClass for the current model |
keeper | is the Keeper for the current model |
weight | is the weight for the likelihood component |
name | is the name for the likelihood component |
|
inlinevirtual |
This is the default BoundLikelihood destructor.
|
inlinevirtual |
This function will calculate the likelihood score for the current model.
TimeInfo | is the TimeClass for the current model |
Implements Likelihood.
|
virtual |
This function will calculate the likelihood score for the current model after adjusting the parameters.
Reimplemented from Likelihood.
|
virtual |
This function will print the summary MigrationPenalty likelihood information.
outfile | is the ofstream that all the model information gets sent to |
Implements Likelihood.
|
virtual |
This function will print summary information from the BoundLikelihood likelihood calculation.
outfile | is the ofstream that all the model likelihood information gets sent to |
Reimplemented from Likelihood.
|
virtual |
This function will reset the bounds information for the likelihood calculation.
keeper | is the Keeper for the current model |
Reimplemented from Likelihood.
|
protected |
This is the default weight applied when the lower bound is exceeded.
|
protected |
This is the default power applied when the bound is exceeded.
|
protected |
This is the default weight applied when the upper bound is exceeded.
|
protected |
This is the DoubleVector of the penalty applied when the bound has been exceeded.
|
protected |
This is the DoubleVector of the lower bounds.
|
protected |
This is the DoubleVector of the weights applied when the lower bound has been exceeded.
|
protected |
This is the DoubleVector of the power applied when the bound has been exceeded.
|
protected |
This is the ParameterVector of the names of the input parameters.
|
protected |
This is the DoubleVector of the upper bounds.
|
protected |
This is the DoubleVector of the weights applied when the upper bound has been exceeded.
|
protected |
This is the DoubleVector used to temporarily store the values of the parameters.