Errors

Types of error response of a percectual control hierarchy.

BaseErrorType


source

BaseErrorType

 BaseErrorType (flip_error_response=False)

Base class of a type error response. This class is not used direclty by developers, but defines the interface common to all.

RootSumSquaredError


source

RootSumSquaredError

 RootSumSquaredError (flip_error_response=False)

The square root of the sum of the square of the errors.

RootMeanSquareError


source

RootMeanSquareError

 RootMeanSquareError (flip_error_response=False)

The square root of the mean of the sum of the square of the errors.

SummedError


source

SummedError

 SummedError (flip_error_response=False)

Sum of all errors.

SummedError


source

CurrentError

 CurrentError (flip_error_response=False)

The current error, rather than a function of the historical values.

CurrentError


source

SmoothError

 SmoothError (flip_error_response=False)

The exponential smoothed value of the error.

MovingSumError


source

MovingSumError

 MovingSumError (flip_error_response=False)

The moving sum of the error.

MovingAverageError


source

MovingAverageError

 MovingAverageError (flip_error_response=False)

The moving average of the error.

BaseErrorCollector


source

BaseErrorCollector

 BaseErrorCollector (limit, error_response, min=True)

Base class of an error collector. This class is not used direclty by developers, but defines the interface common to all.

TotalError


source

TotalError

 TotalError (limit=None, error_response=None, min=None, **cargs)

A class to collect all the errors of the control system run.

TopError


source

TopError

 TopError (limit=None, error_response=None, min=None, **cargs)

A class to collect all the errors of the top-level nodes.

InputsError


source

InputsError

 InputsError (limit=None, error_response=None, min=None, **cargs)

A class to collect the values of the input values.

ReferencedInputsError


source

ReferencedInputsError

 ReferencedInputsError (limit=None, error_response=None, min=None,
                        **cargs)

A class to collect the values of the input values subtracted from reference values.

RewardError


source

RewardError

 RewardError (limit=None, error_response=None, min=None, **cargs)

A class that collects the reward value of the control system run.

FitnessError


source

FitnessError

 FitnessError (limit=None, error_response=None, min=None, **cargs)

A class that collects the fitness value of the control system run.

ErrorResponseFactory


source

ErrorResponseFactory

 ErrorResponseFactory ()

Initialize self. See help(type(self)) for accurate signature.

ErrorCollectorFactory


source

ErrorCollectorFactory

 ErrorCollectorFactory ()

Initialize self. See help(type(self)) for accurate signature.

rms = RootMeanSquareError()
for i in range(10):
    rms(i)
er = rms.get_error_response()
print(er)
assert er == 5.338539126015656
5.338539126015656
er = RootSumSquaredError()
te = TotalError(error_response=er, limit=250,min=True)   
te.add_error_data([1, 2])
print(te)
TotalError limit:250, limit_exceeded:False, : RootSumSquaredError error_response:2.23606797749979
# hpct = PCTHierarchy(1,1,error_collector=te)
# hpct.run(steps=5, verbose=True)
err=te.error()
print(err)
2.23606797749979
et = ErrorResponseFactory.createErrorResponse('RootSumSquaredError')   
et(102)
print(et.get_error_response())

ec = ErrorCollectorFactory.createErrorCollector('TotalError')   
ec.set_limit(100)
ec.set_error_response(et)
print(ec.error())
102.0
102.0
ec = BaseErrorCollector.collector( 'RootMeanSquareError','InputsError', 10, flip_error_response=True, min=False)
ec.add_error_data([1])
print(ec.error())
print(ec)
-1.0
InputsError limit:10, limit_exceeded:False, : RootMeanSquareError error_response:-1.0
ec.reset()
print(ec)
InputsError limit:10, limit_exceeded:False, : RootMeanSquareError error_response:None