Subject: | |
From: | |
Reply To: | |
Date: | Mon, 27 Nov 2006 12:58:39 -0000 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hi,
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(
"/ec/display/myApp.params");
parameters = new ParameterDatabase(stream)
I think within the ParameterDatabase constructor you need to add
something like:
parents.addElement(new ParameterDatabase(
this.getClass().getResourceAsStream(s)));
to allow for loading parents from the jar.
And in each parameter file you need something like
parent.0 = /ec/gp/koza/koza.params
rather than
parent.0 = ../../gp/koza/koza.params
Hope that helps,
Laurie
-----Original Message-----
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
easily
run it and test my evolutionary experiments. But I have problems
managing
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
into
the problem file?
|
|
|