Yes I had this problem some time ago and found the following solution,
but there may be a better one. If you look in ParameterDatabase there
is a constructor taking and inputStream as an argument which is what is
required when reading from jar.
You can then use something like:
java.io.InputStream stream = getClass().getResourceAsStream(
parameters = new ParameterDatabase(stream)
I think within the ParameterDatabase constructor you need to add
to allow for loading parents from the jar.
And in each parameter file you need something like
parent.0 = /ec/gp/koza/koza.params
parent.0 = ../../gp/koza/koza.params
Hope that helps,
From: ECJ Evolutionary Computation Toolkit
[mailto:[log in to unmask]] On Behalf Of Serethos
Sent: 27 November 2006 12:07
To: [log in to unmask]
Subject: ECJ as executable jar and param files
I want to put ECJ with my extensions in a .jar, so that others can
run it and test my evolutionary experiments. But I have problems
the parameter-files which include each other.
When I define a parameter file for my problem, is there a way to include
other within the jar (e.g. simple.params) or do I have to copy&paste it
the problem file?