42 unsigned int nEle = bound->size;
43 for (
unsigned int i = 0; i < nEle; ++i) {
46 override->getProperty(bound->ele[i], bn.c_str());
49 if (std::isinf(bound->ele[i])) {
50 std::ostringstream os;
51 os << bn <<
" entry of " << boundName
52 <<
" bound is infinite and not overridden. Cannot apply normalization.";
53 throw std::invalid_argument(os.str());
62 MatNd* iModMin = NULL;
63 MatNd* iModMax = NULL;
73 shift = MatNd_clone(iModMax);
74 MatNd_subSelf(shift, iModMin);
75 MatNd_constMulSelf(shift, 0.5);
76 MatNd_addSelf(shift, iModMin);
79 scale = MatNd_clone(iModMax);
80 MatNd_subSelf(
scale, iModMin);
81 MatNd_constMulSelf(
scale, 0.5);
84 MatNd_destroy(iModMax);
85 MatNd_destroy(iModMin);
114 for (
unsigned int i = 0; i < sdim; ++i) {
115 state[i] = (state[i] -
shift->ele[i])/
scale->ele[i];
118 velocity[i] = (velocity[i] -
shift->ele[i + sdim])/
scale->ele[i + sdim];
128 for (
unsigned int i = 0; i < sdim; ++i) {
129 minState[i] = (minState[i] -
shift->ele[i])/
scale->ele[i];
130 maxState[i] = (maxState[i] -
shift->ele[i])/
scale->ele[i];
133 maxVelocity[i] = (maxVelocity[i] -
shift->ele[i + sdim])/
scale->ele[i + sdim];
ObservationModel * wrapped
virtual void getLimits(double *minState, double *maxState, double *maxVelocity) const
virtual std::vector< std::string > getStateNames() const
virtual unsigned int getStateDim() const
const MatNd * getMin() const
virtual std::vector< std::string > getStateNames() const
static void validateAndOverride(MatNd *bound, Rcs::PropertySource *override, const char *boundName, const Rcs::BoxSpace *space)
const BoxSpace * getSpace() const
virtual void computeObservation(double *state, double *velocity, const MatNd *currentAction, double dt) const
virtual std::vector< std::string > getVelocityNames() const
virtual std::vector< ObservationModel * > getNested() const
MatNd * computeObservation(const MatNd *currentAction, double dt) const
const MatNd * getMax() const
virtual unsigned int getVelocityDim() const
OMNormalized(ObservationModel *wrapped, PropertySource *overrideMin, PropertySource *overrideMax)
virtual unsigned int getStateDim() const =0
virtual unsigned int getVelocityDim() const
virtual void getLimits(double *minState, double *maxState, double *maxVelocity) const
virtual std::vector< std::string > getVelocityNames() const
const std::vector< std::string > & getNames() const