tduriez / OpenMLC-Matlab-2

Newer Matlab Implementation of Machine Learning Control
GNU General Public License v3.0
14 stars 6 forks source link

Issue with running an example #8

Open lorenzoschena opened 3 years ago

lorenzoschena commented 3 years ago

Hello there,

I am trying to use OpenMLC2 in order to reproduce the results shown for the second example of the book: the unidimensional ode control.

So, I've downloaded the package and installed throughout the toolbox manager of Matlab. Thereafter I've opened the /MLCtools/Demo folder in which this testcase was stored.

Following the book's intructions, I should be able to instantiate the object calling: mlc = MLC2('unidim_DS_script);

But as soon as I do that I receive the following error:

Warning: The following error was caught while executing 'onCleanup' class destructor:
Maximum recursion limit of 500 reached.

Error in run (line 51)
    cleaner = onCleanup(@() resetCD(startDir,fileDir));

Caused by:
    Maximum recursion limit of 500 reached. 
Warning: The following error was caught while executing 'onCleanup' class destructor:
Maximum recursion limit of 500 reached.

Error in run (line 28)
if isstring(scriptname)

Caused by:
    Maximum recursion limit of 500 reached. 
Maximum recursion limit of 500 reached.

Error in run (line 55)
pathscript = evalin('caller', strcat('which(''', script, ''')'));

Caused by:
    Maximum recursion limit of 500 reached.

Probably I'm instatiating the experiment wrong, but I did not suceeded in founding any other documentation except for the instructions written in the book.

Thank you!

tduriez commented 3 years ago

Hello Lorenzo, thanks for your interest in our work. The book examples where writen with the first version of MLC and I have to confess that I never took time to make sure all examples where translated to MLC2 and it seems this is one of them. With the current context (pandemia, no childcare, all work takes more time etc...) I cannot give you a reliable time frame about when to expect an update regarding this. I will look into it during the next three days and either post a fix or a comment. I apologize for the inconvenience.

tduriez commented 3 years ago

Hello Lorenzo, I just tested the case qnd it worked just fine for me with a fresh download of the toolbox. What is your OS and Matlab version? can you reproduce the error, execute the following commands: err=lasterror; save err err and send me the err.mat file generated? Thank you

lorenzoschena commented 3 years ago

Hello mr. Duriez, thank you for your quick reply.

I am attaching a .zip folder in which you will find the err.mat file that you asked for. Moreover, I'm also attaching the main script in which I'm calling the 'unidim_DS_script', I might have made some silly error in instatiating the object.

My working folder is the one in which I do have the files of @MLC2 and I have installed the toolbox properly with the packages setup wizard of MATLAB, I don't know where to look for the error elsewhere.

issue_#8_MLC2.zip

Thanks!

crismze commented 3 years ago

I think there's a recursion because your custom script has the same name as the script used for constructing the mlc object. Save your script as 'my_unidim_DS_script.m'.

Note that your main script has the same name as the scripts provided with the demo, therefore the mlc object is calling itself over and over.

lorenzoschena commented 3 years ago

Thank you for your feedback. That was for sure part of the problem.

Now that I've changed my custom script name, it seems to successfully locate the example, even though I'm still not able to launch the test. I receive the following:

`Unrecognized function or variable 'opset'.`

Error in MLC2 (line 77)
            obj.parameters.opset=opset(obj.parameters.opsetrange);

Am I missing some dependency?

Many thanks,

tduriez commented 3 years ago

Dear Lorenzo, opset.m is in the MLCtools folder, which you should add to the Matlab's path. Sorry for the lack of proper documentation. I hope I can find time to do it properly in the future.