Properties p = new Properties(System.getProperties());
p.load(new FileInputStream(new File(config_path)));
System.setProperties(p);
RRLAlgorithm algorithm = (RRLAlgorithm)AgentProperties.getAlgorithmClass().newInstance();
algorithm.load();
GameInformation game_infos = GameReasoner.createGameInfo(path_to_gdl);
List<Agent> agents = new ArrayList<Agent>();
for(TermObject t : game_infos.getRoles())
{
agents.add(new GDLAlgorithmAgent(t.toString()));
}
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();
}
catch(Exception e)
{
throw new RuntimeException(e);
}