API interaction with the back-end #166
-
Hello, we are working on a project that utilizes UniTime as backend service through API calls,
The only thing that's missing is loading the solver, starting the solver, (after some time)stop the solver, save the best timetable, & commit the timetable, and finally unload the solver. My question is are we able to do all that using the scripts API? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is an option not to use UniTime at all. It is possible to run the solver by itself -- as a Java program, either called programmatically (from within Java) or from a command line. It takes an XML file (with the course timetabling problem), runs for the given amount of time, and produces a new XML file containing the solution. See github.com/UniTime/cpsolver for more details. Please note that it takes a different XML (see the format here, which can be exported from UniTime). Back to your question, it is possible to start/stop/etc the solver using the JSON RPC calls and simulating the Solver page with the SolverPageRequest and SolverPageResponse messages. Here is an example:
Where
This will return the list of available solver configurations and other parameters shown on the page, together with the owners (solver groups) for which the course timetabling solver can be run. See the Course Timetabling Solver on our online demo to interpret the data. It will also show if there is a solver already running for the user (each user can only have one course timetabling solver running at a time).
Operation is START (which will also do the load if there is no solver loaded in), than there needs to be the list of solver groups (owners) for which the solver should run and the solver configuration to use. You do not need to set any other parameters as UniTime will take the defaults in this case -- which you can change on the Solver Configurations page. In particular, you can change the |
Beta Was this translation helpful? Give feedback.
There is an option not to use UniTime at all. It is possible to run the solver by itself -- as a Java program, either called programmatically (from within Java) or from a command line. It takes an XML file (with the course timetabling problem), runs for the given amount of time, and produces a new XML file containing the solution. See github.com/UniTime/cpsolver for more details. Please note that it takes a different XML (see the format here, which can be exported from UniTime).
Back to your question, it is possible to start/stop/etc the solver using the JSON RPC calls and simulating the Solver page with the SolverPageRequest and SolverPageResponse messages. Here is an example: