Re: mixing programs

6 views
Skip to first unread message

Brian Tanner

unread,
Aug 10, 2015, 1:21:24 PM8/10/15
to Amir Hossein Mojarrad, rl-li...@googlegroups.com
Is the file in the right place?

Is there a file called: EpsilonGreedyTileCodingSarsaLambda.jar in the products folder?


For the error in your second email, it looks like rl_glue was already running in the background from a previous experiment because the agent is connecting before rl_glue is started.

This can happen when learning to use the system and extra processes end up running in the backround. Make sure you do a ps -aux |grep rl_glue and kill all extra rl_glue instances.


--
Brian Tanner
Operations Manager, Fire Inspector
br...@fireplan.ca
204-975-4901 Extension 102

Fire Plan Strategies: Fire safety training, planning, signs, and supplies across Canada!

On Aug 10, 2015, at 12:31 AM, Amir Hossein Mojarrad <ahmod...@gmail.com> wrote:

Dear Brian

sorry for bothering you this much 

is there any way that i can mix :
-   Mountain car 
- EpsilonGreedyTileCodingSarsaLambda-Java
- SampleExperimentRLGlue-Java

and run the program 


i changed the run.bash from Sample..


#!/bin/bash

#
# Runs an RL-Glue experiment without any RL-Viz fancies.
#


#Don't let this be too scary for you, it's not as bad as it looks.  Running an experiment consists of starting 4 different programs:
# - RL_glue executable
# - Environment
# - Agent
# - Experiment

# The fact that we're starting all 4 parts in a regular way is what makes this look complicated.  This files sources (includes)
#  /system/scripts/rl-library-includes.sh
# If you check out that file you'll see there is no magic.

#Path back to rl-library main directory from here
basePath=..
systemPath=$basePath/system
GluePath=$basePath/system/common/libs/rl-glue-java/JavaRLGlueCodec.jar

productsPath=$basePath/products

#Source a script that sets all important functions and variables
source $systemPath/scripts/rl-library-includes.sh

#Compile SampleExperiment
mkdir -p classes
javac -d classes -classpath $GluePath src/SampleExperiment.java

#Start Agent in background
###java -jar $productsPath/RandomAgent.jar &
java -jar $productsPath/EpsilonGreedyTileCodingSarsaLambda.jar



#Start Environment in background
java -jar $productsPath/MountainCar.jar &

startRLGlueInBackGround

java -classpath $GluePath:./classes SampleExperiment


 

and then i use : all versions of all above files 

the error is  "





Error: Unable to access jarfile ../products/EpsilonGreedyTileCodingSarsaLambda.jar
Starting up RL-glue - PID=5498
RL-Glue Version 3.04, Build 909
RL-Glue is listening for connections on port=4096
Exception in thread "main" java.lang.NoClassDefFoundError: rlVizLib/messaging/interfaces/getEnvMaxMinsInterface
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Caused by: java.lang.ClassNotFoundException: rlVizLib.messaging.interfaces.getEnvMaxMinsInterface
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 13 more
RL-Glue Java Experiment Codec Version: 2.07 (Build:836M)
        Connecting to 127.0.0.1 on port 4096...
        Experiment Codec Connected
        RL-Glue :: Experiment connected.
 java.lang.NoClassDefFoundError



-- 



--

--
Sincerely Yours
Amir Hossein Mojarrad
Enterprise Administrator (MCITP) #SR6485499
ISO 27001- DNV : # 011-THR-IS-00115081
Mikrotik certified  (MTCNA) :# 1111NA006
--------------------------------------------------
IRIK.Co
URL: www.irik.ir
Phone : +98(0)713 6274400
Fax : +98(0)7136274400
Mobile / Viber  : +98(0)917 302 83 29
Email : ahm...@gmail.com
Email : a.moj...@irik.ir
Skype : Amir.Hussein.Modjarrad
MSN : ahmod...@gmail.com

Brian Tanner

unread,
Aug 10, 2015, 2:45:01 PM8/10/15
to Amir Hossein Mojarrad, rl-li...@googlegroups.com
The sample experiment was kept extremely simple so-as to be easy to see the key pieces of RL-Glue in action.

It does not include code ask the environment for the types of observations and actions that are allowed nor does it pass that information back to the environment.

Those features are beyond the basic RL-Glue specification.  Both this environment and this agent support those features via the ParameterHolder class in the RL-Viz project… but there is not a fully worked out example that I can easily point you to in order to get started.

As I have hinted a bit already - I’m not sure this is the best path to get your feet with with tile coding...


--
Brian Tanner
Operations Manager, Fire Inspector
br...@fireplan.ca
204-975-4901 Extension 102

Fire Plan Strategies: Fire safety training, planning, signs, and supplies across Canada!

On Aug 10, 2015, at 1:15 PM, Amir Hossein Mojarrad <ahmod...@gmail.com> wrote:

Brian 

By the way 

do i have to change :


C:\Users\Amirhossein\Desktop\NILO\ni\EpsilonGreedyTileCodingSarsaLambda-Java-R30\EpsilonGreedyTileCodingSarsaLambda-Java-R30\src\org\rlcommunity\btanner\agentLib\normalizers\ObservationNormalizer.java (1 hit)
Line 28: //                //Quick cheat for mountain car

C:\Users\Amirhossein\Desktop\NILO\ni\EpsilonGreedyTileCodingSarsaLambda-Java-R30\system\common\ant\build-common.xml (1 hit)
Line 4: <!-- This script will believe it is wherever you imported it from.  So, if you import it from environments/mountainCar then to access system you need to tack on ../../system
 
 C:\Users\Amirhossein\Desktop\NILO\ni\EpsilonGreedyTileCodingSarsaLambda-Java-R30\system\common\ant\build-targets.xml (1 hit)
Line 4: This script will believe it is wherever you imported it from.  So, if you import it from environments/mountainCar then to access system you need to tack on ../../system
 

C:\Users\Amirhossein\Desktop\NILO\ni\EpsilonGreedyTileCodingSarsaLambda-Java-R30\system\common\ant\sample-build.xml (4 hits)
Line 10: <!-- You WILL HAVE TO CHANGE THESE :: Current values are from the Mountain Car project -->
Line 12: <property name="main.package.name" value="org.rlcommunity.environments.mountaincar/"/>
Line 20: <property name="jar.main.class" value="org.rlcommunity.environments.mountaincar.MountainCar" />
Line 20: <property name="jar.main.class" value="org.rlcommunity.environments.mountaincar.MountainCar" />


thank you for your time 

Reply all
Reply to author
Forward
0 new messages