// sets the satisfaction value of this Action public void SetGoalSatisfaction(AIGoals goal, float value) { if (!GoalSatisfaction.ContainsKey(goal)) { GoalSatisfaction[goal] = value; } }
// Use this for initialization void Start() { motorActions = GetComponent <AIMotorActions>() as AIMotorActions; raycastSensors = GetComponent <AIRaycastSensors>() as AIRaycastSensors; contactSensor = GetComponentInParent <CharacterContactSensor> () as CharacterContactSensor; goals = GetComponent <AIGoals> () as AIGoals; parentTransform = this.transform.parent; }
// the goal to achieve (constructor) public Goals(AIGoals type, float goalvaluemin, float goalvaluemax, float currentvalue, GoalValuefunction utilityfunction) { goaltype = type; MinimumGoalValue = goalvaluemin; MaximumGoalValue = goalvaluemax; Gvalue = currentvalue; UtilityValue = utilityfunction; }
// returns the amount this action can satisfy a certain goal public float EvaluateGoalSatisfaction(AIGoals TypeToCheck) { if (GoalSatisfaction.ContainsKey(TypeToCheck)) { return(GoalSatisfaction[TypeToCheck]); } return(0); }
//takes in two parameters one is the tyoe of goal this is //second is the goals value that needs to be updated public void UpdateGoalValue(AIGoals Type, float value) { foreach (Goals goal in goallist) { if (goal.TypeReturn() == Type) { goal.SetValue(value); } } }
// Use this for initialization void Start() { AIGoals goalMaker = new AIGoals(); goalMaker.CreateGoals(); goals = goalMaker.GetGoals(); goalMaker = null; stateMaker = new AIState(); stateMaker.MakeStates(); states = stateMaker.state; stateMaker = null; }
void Awake() { a = this; }
// Use this for initialization void Start() { virtualController = GetComponent <AIVirtualController>() as AIVirtualController; goals = GetComponent <AIGoals> () as AIGoals; parentTransform = this.transform.parent; }