package be.iminds.iot.dianne.rl.command;

import java.util.HashMap;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import be.iminds.iot.dianne.api.rl.Agent;

/**
 * Separate component for rl commands ... should be moved to the command bundle later on
 */
@Component(
		service=Object.class,
		property={"osgi.command.scope=dianne",
				  "osgi.command.function=act"},
		immediate=true)
public class DianneRLCommands {

	// TODO could be multiple agents?
	private Agent agent;
	
	public void act(String nnName, String environment, String experiencePool){
		try {
			agent.act(nnName, environment, experiencePool, new HashMap<String, String>());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	
	@Reference
	public void setAgent(Agent agent){
		this.agent = agent;
	}
}

@@ -540,16 +540,108 @@
 gent;%0A%09%0A
+%09public void act(String nnName, String environment)%7B%0A%09%09act(nnName, environment, null);%0A%09%7D%0A%09%0A
 %09public 

add RL command without experiencepool