Пример #1
0
    public void SetTransition(Transition t)
    {
        StateID NextActionStateID = fsm.CurrentState.GetOutputState(t);

        //only attack action need to check attack AI strategy
        if (StateIDToActionID.ContainsKey(NextActionStateID))
        {
            Action NextAction  = StateIDToActionID[NextActionStateID];
            float  ActionValue = DragonKnowledge.GetStateActionValue(fsm.CurrentState.MDPQstate.EndState, NextAction);
            if (ActionValue < -0.006 || DragonKnowledge.GetStateLearningInfo(fsm.CurrentState.MDPQstate.EndState))
            {
                //performing UCB and find the next action
                StateID NextStateID = DragonKnowledge.UCBPolicy(fsm.CurrentState.MDPQstate.EndState);
                fsm.PerformAITransition(NextStateID);
                return;
            }
        }

        fsm.PerformTransition(t);
    }