Can't convert old diagram (problem in version)

classic Classic list List threaded Threaded
1 message Options
leohpaz leohpaz
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Can't convert old diagram (problem in version)


I'm running a genetic algorithm to optmize a function using Scilab and Xcos, but this error keeps showing up. Actually, it will still happen even if I just keep on running the diagram repeatedly without the genetic algorithm. If it helps, my code is:

// ----------------------------------------------------------------------------------------------------------------
clear; clc;

function f=teste(x)
    loadXcosLibs(); loadScicos();
    importXcosDiagram(DIAGRAM PATH);

    Context.S= 20;
    Context.tau = x(1);
    Context.zeta = x(2);


    result = [A.time,A.values];
    f = set_time(result,95);


PopSize     = 100;
Proba_cross = 0.5;
Proba_mut   = 0.3;
NbGen       = 10;
NbCouples   = 100;
Log         = %T;
nb_disp     = 50; // Nb point to display from the optimal population
pressure    = 0.1;

ga_params = init_param();
ga_params = add_param(ga_params,'dimension',2);
ga_params = add_param(ga_params,'minbound',[0,0]);
ga_params = add_param(ga_params,'maxbound',[10,1]);

[pop_opt, fobj_pop_opt, pop_init, fobj_pop_init] = optim_moga(teste, PopSize,NbGen, Proba_mut, Proba_cross, Log, ga_params);

// ----------------------------------------------------------------------------------------------------------------

where set_time is a function that I've created that works fine by itself and A is the matrix created by the block "To Workspace" in Xcos. Thoughts on that? Thanks in advace.