Skip to content

SolveJob

A SolveJob represents a job for solving an optimization problem using LunaSolve. For more details, visit the API Reference.


Get Status of a SolveJob

You can retrieve the status of a SolveJob with:

Python
solve_job.get_status()

By specifying the status_source with remote you enforce retrieving the status from the LunaPlatform.

Python
solve_job.get_status(status_source='remote')

The default behavior is cached and uses the status retrieved from the cached status.

Get the Results of a SolveJob

Retrieve the results of the SolveJob from Luna with:

Python
result = solve_job.result()

This will wait until the result is available. You can specify a timeout.

Refer to Solution how to evaluate the result object.

Cancel a SolveJob

You can cancel a SolveJob as long as it hasn't started yet. To cancel a SolveJob use:

Python
solve_job.cancel()

Deleting a SolveJob

If you no longer need the SolveJob including its results, then you can delete it with:

Python
solve_job.delete()

Hint

Delete finished SolveJobs. Use the cancel method to cancel the execution of the SolveJob.