Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::PCVectorLimits Class Reference
[PerformanceCriteria]

PCVectorLimits is an abstract class for criteria which avoids the limits of a vector. More...

#include <PCVectorLimits.h>

Inheritance diagram for OSCAR::PCVectorLimits:

Inheritance graph
[legend]
List of all members.

Public Methods

 PCVectorLimits (const String &limitsFile, unsigned int noCols)
 PCVectorLimits (const Matrix &limitsFile)
 PCVectorLimits (const Vector &limitsFile)
 PCVectorLimits ()
 PCVectorLimits (const PCVectorLimits &crit)
PCVectorLimits & operator= (const PCVectorLimits &crit)
const MatrixGetLimits () const
bool SetLimits (const Matrix &limits)
const VectorGetIndividualWeights () const
bool SetIndividualWeights (const Vector &vectorWeights)
const VectorUINTGetIndividualExponents () const
bool SetIndividualExponents (const VectorUINT &vectorExponents)
bool SetExponents (unsigned int exponent)
const VectorGetIndividualActiveBoundaries () const
bool SetIndividualActiveBoundaries (const Vector &activeBoundaries)
void SetActiveBoundaries (double activeBoundary)
void SetSummationMethod (bool summation)
const VectorGetRanges () const
const VectorGetMedians () const
const VectorGetActiveUpperBounds () const
const VectorGetActiveLowerBounds () const
virtual ~PCVectorLimits ()

Protected Methods

bool update (VectorArray &values)
void calculateRangesAndMedians ()
void calculateActiveBounds ()
bool computeGradient (const Vector &value, Vector &gradient)

Protected Attributes

unsigned int DOF
bool summationMethod
Matrixlimits
Vectormedians
Vectorranges
VectorvectorWeights
VectorUINTvectorExponents
VectoractiveUpperBounds
VectoractiveLowerBounds
VectoractiveBoundaries

Detailed Description

Author:
Mark Tisius and Chetan Kapoor
PCVectorLimits is derived from PerformanceCriteria. It is an intermediate class that contains the functionality to compute the distance from vector limits. Joint limits criteria such as PCJointRangeAvailability and PCVelocityLimitsAvoidance are derived from it. In the future end-effector limits criteria could also be developed from this class. Get/Set Methods for individual vector components are contained in this class.

Todo:
Create a method which checks for actual limit violation and sets validity of the solution. Currently, the computeCriteria method generates a sum of limits, allowing some elements of the vector to exceed the limits. (to allow "performance reserve" functionality)

Add other ways of computing the criteria value, e.g. vector norm, worst element, summation(already present)


Constructor & Destructor Documentation

OSCAR::PCVectorLimits::PCVectorLimits const String   limitsFile,
unsigned int    noCols
 

Constructor for PCVectorLimits This constructor creates an abstract object PCVectorLimits that contains the computational ability to compute vector limit criteria. Limits are initialized using a data file.

Parameters:
limitsFile Data file which contains the vector limits for the criteria. If absolute limits are being used then make the data file only one column, but if min/max limits are being used then use two columns. An error will occur if there are more than 2 columns in the data file. There is no internal conversion so joint limits should be specified in radians.
noCols It is used to set the whether a min/max or absolute value is specified in the data file. An error will occur if noCols is anything but one or two.
Exceptions:
dataSizeNotMatch If the data file does not contain one or two columns.
See also:
PCVectorLimits(const Vector& limitsFile)

PCVectorLimits(const Matrix& limitsFile)

OSCAR::PCVectorLimits::PCVectorLimits const Matrix   limitsFile
 

Constructor for PCVectorLimits This constructor creates an abstract object PCVectorLimits that contains the computational ability to compute vector limit criteria. Limits are initialized using a Matrix.

Parameters:
limitsFile Matrix which contains the vector limits for the criteria. The matrix must have two columns with the vector minimums in the first column and the maximums in the second column. If the number of rows in the matrix don't match the number of joints then an error will occur when computeCriteria is called. There is no internal conversion so angular limits should be specified in radians.
Exceptions:
matrixSizeMismatch A limits matrix that is not of size n x 2 will cause an error.
See also:
PCVectorLimits(const String& limitsFile, unsigned int noCols)

PCVectorLimits(const Vector& limitsFile)

OSCAR::PCVectorLimits::PCVectorLimits const Vector   limitsFile
 

Constructor for PCVectorLimits This constructor creates an abstract object PCVectorLimits that contains the computational ability to compute vector limit criteria. Limits are initialized using a Vector of maximum values which are assumed to be the absolute value limits. If this is not the case use the constructor that takes a Matrix.

Parameters:
limitsFile Vector which contains the vector limits for the criteria. Be careful if the size of the vector does not match the number of joints in the manipulator then an error will occur when computing a vector limits criteria. There is no internal conversion so angular limits should be specified in radians.
See also:
PCVectorLimits(const String& limitsFile, unsigned int noCols)

PCVectorLimits(const Matrix& limitsFile)

OSCAR::PCVectorLimits::PCVectorLimits  
 

Constructor for PCVectorLimits This constructor creates an abstract object PCVectorLimits that contains the computational ability to minimize or maximize the values of a vector.

See also:
PCVectorLimits(const String& limitsFile, unsigned int noCols)

PCVectorLimits(const Matrix& limitsFile)

OSCAR::PCVectorLimits::PCVectorLimits const PCVectorLimits &    crit
 

Copy Constructor for PCVectorLimits Use this to create a PCVectorLimits object whose defaults are set via the constructor argument.

Parameters:
crit: A PCVectorLimits object that is used to create the new object

virtual OSCAR::PCVectorLimits::~PCVectorLimits   [virtual]
 

Destructor for PCVectorLimits.


Member Function Documentation

void OSCAR::PCVectorLimits::calculateActiveBounds   [protected]
 

void OSCAR::PCVectorLimits::calculateRangesAndMedians   [protected]
 

bool OSCAR::PCVectorLimits::computeGradient const Vector   value,
Vector   gradient
[protected]
 

const Vector& OSCAR::PCVectorLimits::GetActiveLowerBounds   const
 

Returns the active lower bounds for the vector. Use this method to return a Vector of the active uppper bounds for the criteria.

Returns:
Vector containing the active uppper bounds of the limits specified by the user. The size will match the number of rows in the limits matrix.

const Vector& OSCAR::PCVectorLimits::GetActiveUpperBounds   const
 

Returns the active upper bounds for the vector. Use this method to return a Vector of the active uppper bounds for the criteria.

Returns:
Vector containing the active uppper bounds of the limits specified by the user. The size will match the number of rows in the limits matrix.

const Vector& OSCAR::PCVectorLimits::GetIndividualActiveBoundaries   const
 

Gets the individual active boundaries of the vector criteria. Use this method to return a Vector of the individual active boundaries of the vector criteria.

Returns:
Vector& Holds the individual active boundaries. Will be the size of the number of rows in the limits matrix.

const VectorUINT& OSCAR::PCVectorLimits::GetIndividualExponents   const
 

Gets the individual component exponents of the vector criteria. Use this method to return a Vector of the individual component exponents of the vector criteria.

Returns:
Vector& Holds the individual component exponents. Will be the size of the number of rows in the limits matrix.

const Vector& OSCAR::PCVectorLimits::GetIndividualWeights   const
 

Gets the individual component weights of the vector criteria. Use this method to return a Vector of the individual component weights of the vector criteria.

Returns:
Vector& Holds the individual component weights. Will be the size of the number of rows in the limits matrix.

const Matrix& OSCAR::PCVectorLimits::GetLimits   const
 

Returns the vector limits of the criteria. Use this method to return a Matrix of the vector limits for the criteria. It returns maximums and minumums even if absolute values were used in the constructor.

Returns:
Matrix Contains the limits being used by the criteria.
See also:
GetLimits(Matrix& limits)

const Vector& OSCAR::PCVectorLimits::GetMedians   const
 

Returns the medians for the vector. Use this method to return a Vector of the vector medians for the criteria.

Returns:
Vector containing the medians of the limits specified by the user. The size will match the number of rows in the limits matrix.

const Vector& OSCAR::PCVectorLimits::GetRanges   const
 

Returns the ranges for the vector. Use this method to return a Vector of the vector ranges for the criteria.

Returns:
Vector Contains the ranges of the limits specified by the user. The size will match the number of rows in the limits matrix.

PCVectorLimits& OSCAR::PCVectorLimits::operator= const PCVectorLimits &    crit
 

Copy operator for PCVectorLimits Use this to copy one PCVectorLimits object into another. If the size of the objects do not match, the object being copied into (LHS) is modified to match the RHS.

Returns:
A reference to itself
Parameters:
crit A PCVectorLimits object that is copied into the calling object.

void OSCAR::PCVectorLimits::SetActiveBoundaries double    activeBoundary
 

Sets the active boundaries of the vector criteria.

Same as SetIndividualActiveBoundaries method above except, this one sets all the active boundaries to the same value.

Parameters:
activeBoundary the new active boundary for all of the vector criteria.

bool OSCAR::PCVectorLimits::SetExponents unsigned int    exponent
 

Sets the component exponents of the vector criteria.

Same as SetIndividualExponents method above except, this one sets all the component exponents to the same value.

Parameters:
exponent the new component exponent for all of the vector criteria. Must be a positive even number.
Returns:
false if exponent is not positive even.

bool OSCAR::PCVectorLimits::SetIndividualActiveBoundaries const Vector   activeBoundaries
 

Sets the individual active boundaries of the vector criteria. Use this method to set the individual active boundaries of the vector criteria. The active boundary is where the criteria will become active. It's defined as a percentage of the whole range from the limits. For example, a value of 0.2 means that if the criteria value is within 20% of its limit, then the criterion will be active. A value of 1 means that the criterion is always active and a value of 0 means the criterion is never active.

Returns:
bool True if successful, False otherwise
Parameters:
activeBoundaries Vector that contains the new active boundaries of the vector criteria. The size must match the number of rows in the limits matrix or an error will occur.
Exceptions:
vectorSizeMismatch. This is set when the argument size is not equal to the the number of rows in the limits matrix

bool OSCAR::PCVectorLimits::SetIndividualExponents const VectorUINT   vectorExponents
 

Sets the individual component exponents of the vector criteria. Use this method to set the individual component exponents of the vector criteria. Each individual component exponent must be a positive even number.

Returns:
bool True if successful, False otherwise
Parameters:
vectorExponents Vector that contains the new component exponents of the vector criteria. The size must match the number of rows in the limits matrix or an error will occur.
Exceptions:
vectorSizeMismatch. This is set when the argument size is not equal to the the number of rows in the limits matrix

bool OSCAR::PCVectorLimits::SetIndividualWeights const Vector   vectorWeights
 

Sets the individual component weights of the vector criteria. Use this method to set the individual component weights of the vector criteria.

Returns:
bool True if successful, False otherwise
Parameters:
vectorWeights Vector that contains the new component weights of the vector criteria. The size must match the number of rows in the limits matrix or an error will occur.
Exceptions:
vectorSizeMismatch. This is set when the argument size is not equal to the the number of rows in the limits matrix

bool OSCAR::PCVectorLimits::SetLimits const Matrix   limits
 

Sets the vector limits for the criteria from a Matrix object. Use this method to set the vector limits to those specified in the Matrix limits. Matrix must have the same number of rows as the one given in the constructor or an error will occur.

Returns:
bool True if successful, False otherwise
Parameters:
limits Matrix that contains the new vector limits. Matrix limits must be the same size as the one initialized in the constructor or an error will occur. There is no internal conversion so angular limits should be specified in radians.
Exceptions:
matrixSizeMismatch. This is set when the argument size is not equal to the size of the Matrix limits set in the constructor.
Todo:
Add a SetLimits which takes an Vector.

void OSCAR::PCVectorLimits::SetSummationMethod bool    summation
 

Sets the method to compute the vector limit criteria.

There are two methods. One is the summation method where the individual deviations from the medians is added. The other is the maximum method where the maximum value of all the deviations is chosen. The summation method is smooth but does not give true indication of a sense of urgency when one joint is near its limit but other joints are far away. The maximum method does that but is not smooth and should not be used with any optimization technique that requires gradient of the criteria.

Parameters:
sum If true, the summation method is used. False will use the maximum method. criteria.

bool OSCAR::PCVectorLimits::update VectorArray   values [protected]
 


Member Data Documentation

Vector* OSCAR::PCVectorLimits::activeBoundaries [protected]
 

Vector* OSCAR::PCVectorLimits::activeLowerBounds [protected]
 

Vector* OSCAR::PCVectorLimits::activeUpperBounds [protected]
 

unsigned int OSCAR::PCVectorLimits::DOF [protected]
 

Matrix* OSCAR::PCVectorLimits::limits [protected]
 

Vector* OSCAR::PCVectorLimits::medians [protected]
 

Vector* OSCAR::PCVectorLimits::ranges [protected]
 

bool OSCAR::PCVectorLimits::summationMethod [protected]
 

VectorUINT* OSCAR::PCVectorLimits::vectorExponents [protected]
 

Vector* OSCAR::PCVectorLimits::vectorWeights [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations