FET Forum

FET Support (English) => Programming Help => Topic started by: moris on November 20, 2008, 10:52:33 PM

Title: initialize structure of engine!
Post by: moris on November 20, 2008, 10:52:33 PM
I try to integrate  FET with a java application as DLL, i have succeed to load library and turn up the engine but when i try to reuse engine for another instance i get message box alert.
please how can i initialize structure of engine for reuse it!
Title: Re: initialize structure of engine!
Post by: Liviu Lalescu on November 21, 2008, 05:31:00 AM
Are you using an older version of FET? This is because the reported line is not the same on my hard disk. If so, maybe you could use the latest version of FET and tell me the new error message.
Title: Re: initialize structure of engine!
Post by: moris on November 22, 2008, 09:35:49 AM
when i ignore a "assertion failed" i get this message in the console:

Duplicate room - 1
Cannot precompute - data is wrong - aborting


i tried to initialize the structure of engine with an init() function in fet.cpp that i invoke it after each execution of engine:

extern "C" void init(){
                 INPUT_FILENAME_XML="";

                 gt.rules.kill();
                 gt.rules.init();

                 
                 students_schedule_ready=false;
                 teachers_schedule_ready=false;
                 rooms_schedule_ready=false;
}


but without success!

please, what can i need to initialize the entire structure of engine!

Title: Re: initialize structure of engine!
Post by: Liviu Lalescu on November 22, 2008, 09:44:31 AM
You should leave the asserts in place, they are correct.

It seems that when you read the .fet file, you read the same room multiple times.

I don't know where the error is.

If it is possible to compile your project under GNU/Linux, maybe you could send me your code.
Title: Re: initialize structure of engine!
Post by: moris on November 22, 2008, 10:14:48 AM
this is the entire code of fet.cpp, i used solve function as entry point to run up the engine.
Title: Re: initialize structure of engine!
Post by: Liviu Lalescu on November 22, 2008, 10:23:26 AM
Please send me your whole project, so I can compile it and see why the asserts fail. Only if it is compilable under GNU/Linux.
Title: Re: initialize structure of engine!
Post by: Liviu Lalescu on November 22, 2008, 10:29:14 AM
I see that you use Rules::read with 3 parameters. This means that you modified the Rules class. What modification did you make?
Title: Re: initialize structure of engine!
Post by: moris on November 24, 2008, 09:57:11 AM
this is the file of rules.cpp with modification.
Title: Re: initialize structure of engine!
Post by: Liviu Lalescu on November 24, 2008, 11:47:56 AM
I see that you use a char* string, and you don't read rules from a file, but from this string. Probably here appear the bugs. Please try to read from a file firstly and see if you still get assert failed. If not, then you know the source of this bug.