[EvA] Help with Matlab Interaction

Marcel Kronfeld marcel.kronfeld at uni-tuebingen.de
Thu Dec 4 14:13:12 CET 2008


Hey there,

Ive been working with Matlab and the JEInterface a lot in the last time,
so it basically works. The first thing I notice is that in the line

jvi=JEInterface('JI', at MYFUNC,R)

the first argument should be the char representation of the JE-variable
name, meaning:

jvi=JEInterface('jvi', at MYFUNC,R)

The next thing to check would be whether MYFUNC really returns a double
array and maybe try a simplified test function first, e.g., something like:

function [z] = testfun(x, y)
z(1)=sum(x.*x);

and look if this can be optimized. Ive not had the time to reproduce
your specific exception, but Ill try to look into it later.

I dont know of any experience with EvA2 and Octave, so Id be glad to
learn more about it or see a short example!

Best regards,
Marcel Kronfeld

Fabrizio Sciarra wrote:
> Hi all...
> Sorry if this has been already answered somewhere... I can't find it...
> looks like the pipermail site is down...
> I'm currently trying to use EvA2 to optimize a Matlab function.
> I'd like to do it with Octave, also...
> Up to now I'm faulty in both directions... good eh? :-)
> I'm putting the java calls octave wants in the various .m files (apart
> that I've been forced to untar JEInterface in my current directory,
> while this works with Matlab).
> Now both Matlab and Octave complains, when I try to run the
> optimization, with the same error. (the dump is at the end of the mail)...
> I know I'm doing something wrong but don't know where to look to find
> what...
> Can anyone help me?
> Does anyone have a complete working example? Has anyone already used Octave?
> If nobody has done it, yet, I'll post the code for Octave as a
> contribution when it's working, if it gets accepted...
> Take in advance
>   Fabrizio
> ----------------------------------------
> My Operations:
> javaaddpath "/projects/osn/optimization/EvA2/EvA2Base.jar"
> R=[[120];[130]]
> jvi=JEInterface('JI', at MYFUNC,R)
> op=optimize(jvi,1)
> ----------------------------------------
> The error after optimize:
> Error in evaluate!
>  Caught exception in Processor: null
> java.lang.NullPointerException
>     at
> eva2.server.go.individuals.AbstractEAIndividual.isDominatingFitness(AbstractEAIndividual.java:552)
>     at eva2.server.go.populations.Population.compareFit(Population.java:319)
>     at
> eva2.server.go.populations.Population.getIndexOfBestOrWorstIndividual(Population.java:364)
>     at
> eva2.server.go.populations.Population.getIndexOfBestIndividual(Population.java:331)
>     at
> eva2.server.go.populations.Population.getBestEAIndividual(Population.java:401)
>     at
> eva2.server.go.populations.Population.getBestIndividual(Population.java:789)
>     at
> eva2.server.stat.AbstractStatistics.createNextGenerationPerformed(AbstractStatistics.java:318)
>     at
> eva2.server.modules.Processor.registerPopulationStateChanged(Processor.java:254)
>     at
> eva2.server.go.strategies.EvolutionStrategies.firePropertyChangedEvent(EvolutionStrategies.java:280)
>     at
> eva2.server.go.strategies.EvolutionStrategies.init(EvolutionStrategies.java:89)
>     at eva2.server.modules.Processor.optimize(Processor.java:196)
>     at eva2.server.modules.Processor.runOptOnce(Processor.java:149)
>     at eva2.OptimizerRunnable.run(OptimizerRunnable.java:99)
>     at java.lang.Thread.run(Thread.java:619)
> ----------------------------------------
> 


-- 
 Dipl.-Inform. Marcel Kronfeld
 Wilhelm-Schickard-Institute for Computer Science
 University of Tuebingen
 Sand 1 - A305, 72076 Tuebingen, Germany

 Phone: (+49/0)-7071-29-78987, Fax: (+49/0)-7071-29-5091
 EMail: marcel.kronfeld at uni-tuebingen.de


More information about the EvA mailing list