Hi, The ::run function is just a special case for using the search engines that come with Gecode and only print solutions. If you want to use search engines directly to get access to solutions rather than just printing them, please consult Chapter 2 in Modeling and Programming with Gecode on how to use search engines and later Chpater 7.
Christian -- Christian Schulte, www.ict.kth.se/~cschulte/ > -----Original Message----- > From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On > Behalf Of chandana.wasalatan...@stud.uni-due.de > Sent: Monday, June 25, 2012 10:37 AM > To: users@gecode.org > Subject: [gecode-users] Gecode integration > > Dear Sir, > I am using Gecode for my university project work for solving optimization > problem.My main objective is a TSP problem.The cost matrix optimization is > done by Gecode.I am using the procedure that you used in the example TSP. > but my problem is that, I am calling the TSP procedures inside of a another > function,looks like here: void call_tsp(void){ > TsPOptions opt(...); > opt.solutions(0); > opt.icl(ICL_DOM); > MinimizeScript::run<TsP,BAB,TsPOptions>(opt); > } and now I want to get the value of the Intvar total > object that is defined in TSP.cpp as an integer.As the why the script method > execute the TSP code it is rather imposible to acces this value inside the > function.I treid something like int a=total.val(); but it will throug an exception. > > I would rather appreciate if you could help me. > > Thank you very much, > Yours sincerely, > C.L.Wasalatantri. > > > _______________________________________________ > Gecode users mailing list > users@gecode.org > https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users