Input Parameters

From AI Product Manuals
Revision as of 15:51, 6 October 2021 by Davemark (talk | contribs) (Initial Entries)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity

This item is a component of a Behavior.

Concept

Input Parameters are items that are specified in individual considerations that include more data for them to use when calculating the consideration. The types of input parameters that are available (and useful) depend on the type of input that is selected for the consideration.

Value Parameters

Some input parameters allow you to set minimum or maximum values that help determine what the normalized x-axis of 0..1 is meant to represent. For example, when calculating the distance to a target, we may only be concerned with ranges under 20m. In that case, by setting the "RangeMax" parameter to 20, the Response Curve is automatically scaled so that the distance of 20m is equal to x = 1.0.

Boolean Parameters

Some input parameters are checking to see if something exists in a Boolean fashion. Because the nature of this type of consideration will only be a "true/false" solution, the response curve for these is usually set to either have [0,0] and [1,1] (for true = 1) or [0,1] and [1,0] (for false = 1).

An example is the input, "HasTag". This input is merely checking to see if the owner has a specified tag. The tag is placed in the input parameters on the consideration—for example "Invisible". Therefore, the consideration would be checking to see if the owner has the tag, "invisible". If so, the input returns "1" and, depending on the orientation of the response curve, the consideration can return 1 or 0.

Implementation

Code

Input Parameters for a consideration are held in a sparse map structure. This is typedef'd in Consideration.h as:

typedef std::unordered_map<InputParameter, float> ParameterMap;

This is then declared as a member of the Consideration object as:

ParameterMap parameters;		// optional parameters for filtering, adding normalization bookends, etc.

The processing of input parameters is done in Consideration.cpp by helper functions. For example, the following block is asking if there is a RangeMax parameter in the consideration.

float paramMax = GetParameterOrDefault(InputParameter::RangeMax, -1.0f);

This accesses the parameter map on the consideration to see if it exists. Otherwise, it returns the default that was passed in.

float Consideration::GetParameterOrDefault(InputParameter thisParam, float thisDefault) const
{
	ParameterMap::const_iterator result = parameters.find(thisParam);
	if (result == parameters.end()) {
		return thisDefault;
	}
	else {
		return result->second;
	}
}

More information on how these are used in the calculation of the consideration can be found in Consideration.cpp.

Data


Website, Manuals wiki, and Product Code ©2021, Intrinsic Algorithm LLC