@@ -0,0 +1,2387 @@
+/*******************************************************************************%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.environment.kuka;%0A%0Aimport org.osgi.service.component.annotations.Component;%0A%0Aimport be.iminds.iot.dianne.api.rl.environment.Environment;%0Aimport be.iminds.iot.dianne.rl.environment.kuka.api.KukaEnvironment;%0Aimport be.iminds.iot.dianne.tensor.Tensor;%0A%0A%0A@Component(immediate = true,%0A%09service = %7BEnvironment.class, KukaEnvironment.class%7D,%0A%09property = %7B %22name=%22+DockingContinuousEnvironment.NAME, %0A%09%09%09%09 %22aiolos.unique=true%22,%0A%09%09%09%09 %22aiolos.combine=*%22,%0A%09%09%09%09 %22osgi.command.scope=dockingcont%22,%0A%09%09%09%09 %22osgi.command.function=start%22,%0A%09%09%09%09 %22osgi.command.function=stop%22,%0A%09%09%09%09 %22osgi.command.function=pause%22,%0A%09%09%09%09 %22osgi.command.function=resume%22,%0A%09%09%09%09 %22osgi.command.function=reward%22,%0A%09%09%09%09 %22osgi.command.function=resetCan%22%7D)%0Apublic class DockingContinuousEnvironment extends DockingEnvironment %7B%0A%09%0A%09public static final String NAME = %22DockingContinuous%22;%0A%09%0A%09@Override%0A%09public String getName()%7B%0A%09%09return NAME;%0A%09%7D%0A%0A%09@Override%0A%09public int%5B%5D actionDims() %7B%0A%09%09return new int%5B%5D%7B3%7D;%0A%09%7D%0A%09%0A%09@Override%0A%09protected void executeAction(Tensor a) throws Exception %7B%0A%09%09float%5B%5D velocities = a.get();%0A%09%09kukaPlatform.move(velocities%5B0%5D*super.config.speed, velocities%5B1%5D*super.config.speed, velocities%5B2%5D*super.config.speed*2);%0A%09%09%0A%09%09// simulate an iteration further%0A%09%09if(simulator != null)%7B%0A%09%09%09for(int i=0;i%3C=super.config.skip;i++)%7B%0A%09%09%09%09simulator.tick();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

add Docking environment with continuous actions