Package fr.irit.halterego.rrl_ggp.base

Examples of fr.irit.halterego.rrl_ggp.base.RState


   
    @Override
    public Action agent_step(double reward, Observation observation)
    {
        String obs_str = new String(observation.charArray);
        RState result = new GDLState(reasoner,obs_str);
       
        current_episode.addTransiton(last_state, last_action, result, reward);
       
        if(explore)
        {
View Full Code Here


            RState            state,
            Episode           episode,
            List<Agent>       agents,
            Agent             learner)
    {
        RState current_state = state;
        while(!current_state.isTerminal())
        {
            List<RAction> chose_actions = new ArrayList<RAction>();
            RAction my_action = null;
           
            for(Agent agent : agents)
            {
                RAction action = decideExplore(current_state, agent.legalActions(current_state));
                chose_actions.add(action);
               
                if(agent.equals(learner))
                {
                    my_action = action;
                }
            }
           
            RState start = current_state;
            current_state = current_state.next(chose_actions);
            RState result = current_state;
            if(result.isTerminal())
            {
                result = null;
            }
            episode.addTransiton(start, my_action, result, learner.getReward(current_state));
        }
View Full Code Here

        learnEpisode(episode,learner);
    }
   
    private void explore(RState state, Map<Agent,Episode> episodes)
    {
        RState current_state = state;
        while(!current_state.isTerminal())
        {
            Map<Agent,RAction> actions = new HashMap<Agent,RAction>();
            for(Agent role : episodes.keySet())
            {
                RAction action = decideExplore(current_state, role.legalActions(current_state));
                actions.put(role,action);
            }
           
            RState start = current_state;
            current_state = current_state.next(actions.values());
            RState result = current_state;
           
            if(result.isTerminal())
            {
                result = null;
            }
           
            for(Agent role : episodes.keySet())
View Full Code Here

            GameReasoner reasoner = new GameReasoner(game_infos);
           
            for(int i = 0; i < iterations; ++i)
            {
                System.out.println("iteration " + i);
                RState state = new GDLState(reasoner);
                algorithm.exploreNewEpisode(state, agents);
            }
               
            algorithm.save();
        }
View Full Code Here

TOP

Related Classes of fr.irit.halterego.rrl_ggp.base.RState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.