@@ -0,0 +1,1924 @@
+/*******************************************************************************%0A * DIANNE  - Framework for distributed artificial neural networks%0A * Copyright (C) 2015  iMinds - IBCN - UGent%0A *%0A * This file is part of DIANNE.%0A *%0A * DIANNE is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A *%0A * Contributors:%0A *     Tim Verbelen, Steven Bohez%0A *******************************************************************************/%0Apackage be.iminds.iot.dianne.rl.agent.strategy;%0A%0Aimport java.util.Map;%0A%0Aimport be.iminds.iot.dianne.api.nn.NeuralNetwork;%0Aimport be.iminds.iot.dianne.api.rl.agent.ActionStrategy;%0Aimport be.iminds.iot.dianne.api.rl.environment.Environment;%0Aimport be.iminds.iot.dianne.tensor.Tensor;%0A%0Apublic class FixedActionStrategy implements ActionStrategy %7B%0A%0A%09private Tensor action;%0A%09%0A%09%0A%09@Override%0A%09public void setup(Map%3CString, String%3E config, Environment env, NeuralNetwork... nns) throws Exception %7B%0A%09%09action = new Tensor(env.actionDims());%0A%09%09%0A%09%09if(config.containsKey(%22action%22))%7B%0A%09%09%09String%5B%5D floats = config.get(%22action%22).split(%22,%22);%0A%09%09%09float%5B%5D data = new float%5Bfloats.length%5D;%0A%09%09%09for(int i=0;i%3Cfloats.length;i++)%7B%0A%09%09%09%09data%5Bi%5D = Float.parseFloat(floats%5Bi%5D);%0A%09%09%09%7D%0A%09%09%09action.set(data);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public Tensor processIteration(long s, long i, Tensor state) throws Exception %7B%0A%09%09return action;%0A%09%7D%0A%09%0A%7D%0A

add fixed action strategy