コード例 #1
0
	public void Awake()
	{
		brain = new iThinkBrain();

		// Sensing GameObjects
		List<String> tags = new List<String>();
		tags.Add( "direction" ); tags.Add( "location" ); tags.Add( "player" ); tags.Add( "npc" ); tags.Add( "gun" ); tags.Add( "knife" );
		brain.sensorySystem.OmniscientUpdate( this.gameObject, tags );

		Debug.LogWarning( "knownObjects count: " + brain.sensorySystem.getKnownObjects().Count );

		// Building knowledge
		SimplegameTest();
		brain.curState = brain.startState;

		// Building Actions from knowledge
		brain.ActionManager = new iThinkActionManager();
		brain.ActionManager.initActionList( this.gameObject, schemaList, brain.getKnownObjects(), brain.startState.getFactList() );
		
		// Init search
		letsPlay = false;
		giveMeHint = false;
		resetEve = false;
		
		brain.planner.forwardSearch( brain.curState, brain.goalState, brain.ActionManager);
		brain.planner.getPlan().debugPrintPlan();
		actionList = brain.planner.getPlan().getPlanActions();
		actionList2 = new List<iThinkAction>(actionList);
		initPosition = new Vector3(this.gameObject.transform.position.x,this.gameObject.transform.position.y,this.gameObject.transform.position.z);
	}
コード例 #2
0
 public void thinkAndExecute(iThinkBrain br, string g)
 {
     brain = br;
     state = 1;
     //writeInitState(brain.startState);
     goal = g;
 }
コード例 #3
0
 public void thinkAndExecute(iThinkBrain br, string g)
 {
     brain = br;
     state = 1;
     //writeInitState(brain.startState);
     goal = g;
 }
コード例 #4
0
    public void Awake()
    {
        brain = new iThinkBrain();

        // Sensing GameObjects
        List <String> tags = new List <String>();

        tags.Add("direction"); tags.Add("location"); tags.Add("player"); tags.Add("npc"); tags.Add("gun"); tags.Add("knife");
        brain.sensorySystem.OmniscientUpdate(this.gameObject, tags);

        Debug.LogWarning("knownObjects count: " + brain.sensorySystem.getKnownObjects().Count);

        // Building knowledge
        SimplegameTest();
        brain.curState = brain.startState;

        // Building Actions from knowledge
        brain.ActionManager = new iThinkActionManager();
        brain.ActionManager.initActionList(this.gameObject, schemaList, brain.getKnownObjects(), brain.startState.getFactList());

        // Init search
        letsPlay   = false;
        giveMeHint = false;
        resetEve   = false;

        brain.planner.forwardSearch(brain.curState, brain.goalState, brain.ActionManager);
        brain.planner.getPlan().debugPrintPlan();
        actionList   = brain.planner.getPlan().getPlanActions();
        actionList2  = new List <iThinkAction>(actionList);
        initPosition = new Vector3(this.gameObject.transform.position.x, this.gameObject.transform.position.y, this.gameObject.transform.position.z);
    }
コード例 #5
0
    public void Awake()
    {
        brain = new iThinkBrain();

        // Sensing GameObjects
        List<String> tags = new List<String>();
        tags.Add( "block" );
        brain.sensorySystem.OmniscientUpdate( this.gameObject, tags );

        // Building knowledge
        initKnowledge();
        brain.curState = brain.startState;

        // Generate actions from knowledge
        brain.ActionManager = new iThinkActionManager();
        brain.ActionManager.initActionList( this.gameObject, schemaList, brain.getKnownObjects(), brain.getKnownFacts() );

        // Init search        
        renderCurrentState();
        brain.planner.forwardSearch( brain.startState, brain.goalState, brain.ActionManager );
    }
コード例 #6
0
    public void Awake()
    {
        brain = new iThinkBrain();

        // Sensing GameObjects
        List <String> tags = new List <String>();

        tags.Add("block");
        brain.sensorySystem.OmniscientUpdate(this.gameObject, tags);

        // Building knowledge
        initKnowledge();
        brain.curState = brain.startState;

        // Generate actions from knowledge
        brain.ActionManager = new iThinkActionManager();
        brain.ActionManager.initActionList(this.gameObject, schemaList, brain.getKnownObjects(), brain.getKnownFacts());

        // Init search
        renderCurrentState();
        brain.planner.forwardSearch(brain.startState, brain.goalState, brain.ActionManager);
    }
コード例 #7
0
ファイル: Agent.cs プロジェクト: Joker77/smart-workers-rts
    //initialize brain, state and goal
    public void brainInit()
    {
        brain = new iThinkBrain();
        //find all game objects by tags
        tags = new List <string>();
        tags.Add("forest");
        tags.Add("mine");
        tags.Add("factory");
        //tags.Add("warehouse");
        //tags.Add("windmill");
        tags.Add("lumberjack");
        tags.Add("magicTower");
        tags.Add("object");
        tags.Add("animal");
        tags.Add("resource");
        tags.Add("weapon");
        tags.Add("tool");
        tags.Add("laboratory");
        tags.Add("armory");
        tags.Add("market");
        tags.Add("lake");
        tags.Add("fishingPole");
        //tags.Add("townhall");
        tags.Add("temple");
        tags.Add("barracks");
        tags.Add("district");
        tags.Add("repository");
        //tags.Add("slaughterhouse");

        brain.sensorySystem.OmniscientUpdate(this.gameObject, tags);
        brain.startState = new iThinkState("Initial", new List <iThinkFact>());
        brain.goalState  = new iThinkState("Goal", new List <iThinkFact>());
        initKnowledge();
        initGoal();
        brain.curState      = new iThinkState(brain.startState);
        brain.ActionManager = new iThinkActionManager();
        brain.ActionManager.initActionList(this.gameObject, actionSchemas, brain.getKnownObjects(), brain.getKnownFacts());
    }
コード例 #8
0
ファイル: Agent.cs プロジェクト: Nirubi/smart-workers-rts
    //initialize brain, state and goal
    public void brainInit()
    {
        brain = new iThinkBrain();
        //find all game objects by tags
        tags = new List<string>();
        tags.Add("forest");
        tags.Add("mine");
        tags.Add("factory");
        //tags.Add("warehouse");
        //tags.Add("windmill");
        tags.Add("lumberjack");
        tags.Add("magicTower");
        tags.Add("object");
        tags.Add("animal");
        tags.Add("resource");
        tags.Add("weapon");
        tags.Add("tool");
        tags.Add("laboratory");
        tags.Add("armory");
        tags.Add("market");
        tags.Add("lake");
        tags.Add("fishingPole");
        //tags.Add("townhall");
        tags.Add("temple");
        tags.Add("barracks");
        tags.Add("district");
        tags.Add("repository");
        //tags.Add("slaughterhouse");

        brain.sensorySystem.OmniscientUpdate( this.gameObject, tags );
        brain.startState = new iThinkState("Initial", new List<iThinkFact>());
        brain.goalState = new iThinkState("Goal", new List<iThinkFact>());
        initKnowledge();
        initGoal();
        brain.curState = new iThinkState(brain.startState);
        brain.ActionManager = new iThinkActionManager();
        brain.ActionManager.initActionList( this.gameObject, actionSchemas, brain.getKnownObjects(), brain.getKnownFacts() );
    }