Package fr.irit.halterego.rrl_ggp.serialization

Examples of fr.irit.halterego.rrl_ggp.serialization.SerializableAction


            for (String role : roles)
            {
                for (RAction raction : min_q.getActions(role))
                {
                    double q = gamma * min_q.get(role,raction);
                    SerializableAction action = getAction(raction);
                    table.addQValue(sstate, role, action, q);
                }
            }
        }
    }
View Full Code Here


            max_q = state.getReward(role);
        }
        else
        {
            SerializableState sstate = getState(state);
            SerializableAction saction = getAction(actions.iterator().next());
            max_q = table.getQValue(sstate, role, saction);
            for (RAction action : state.legalActions(role))
            {
                saction = getAction(action);
                double q = table.getQValue(sstate, role, saction);
View Full Code Here

                {
                    String s = e.getChildren("step-number").get(0).getText();
                    int stepnum = Integer.parseInt(s);
                    String action_term = e.getChildren("move").get(player_id).getText();
                    GroundFact fact = createAction(action_term,role);
                    actions.put(stepnum, new SerializableAction(fact));
                }
            }
           
            // Register the state-action couples by browsing the step_x.xml
            // files in the right order.
            int step = 1;
            while(true)
            {
                String filename = getStateFilename(location,step);
                File file = new File(filename);
               
                if(!file.exists())
                {
                    break;
                }
               
                Element root = builder.build(file).getRootElement();
                List<Element> states = root.getChildren("state");
                SerializableState state = getState(states.get(0));
                SerializableAction action = actions.get(step);
                if(action != null)
                {
                    transitions.add(new Transition(state,action));
                }
               
View Full Code Here

        List<Transition> transitions = match.getTransitions();
       
        int success = 0;
        for (Transition t : transitions)
        {
            SerializableAction best = map.get(role).get(t.getState()).keySet().iterator().next();
            double maxq = map.get(role).get(t.getState()).get(best);
            for(SerializableAction a : map.get(role).get(t.getState()).keySet())
            {
                double q = map.get(role).get(t.getState()).get(a);
                if(q > maxq)
View Full Code Here

        if(qs == null || qs.isEmpty())
        {
            return best_actions;
        }
       
        SerializableAction best_action = qs.keySet().iterator().next();
        double best_q_value = qs.get(best_action);
        best_actions.add(best_action);
        for(SerializableAction action : qs.keySet())
        {
            double q = qs.get(action);
View Full Code Here

TOP

Related Classes of fr.irit.halterego.rrl_ggp.serialization.SerializableAction

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.