monitoring search of the routing

227 views
Skip to first unread message

rdl

unread,
Jan 27, 2012, 7:14:09 AM1/27/12
to or-tools-discuss
Hi there,

I am using the routing package of GoogleCP, which is doing quite
well.
I wanted to know if it is possible to monitor the evolution of the
objective function of the routing package.
I guess it is something like:

SearchMonitor* const monitor = (routing.solver())-
>MakeSearchLog(100000, THE_OBJECTIVE_VARIABLE);
routing.AddSearchMonitor(monitor);

but I do not know how to get the objective variable from the
RoutingModel .

Also, is there a clean way to interrupt a search in such a way that
control is returned from the engine so that the current solution can
be queried? I know about setting the time limit, but I would prefer a
more interactive mechanism.

Thanks in advance.
--
Renaud

Vincent Furnon

unread,
Jan 27, 2012, 7:24:14 AM1/27/12
to or-tools...@googlegroups.com
Hi,

On Fri, Jan 27, 2012 at 1:14 PM, rdl <rena...@gmail.com> wrote:
Hi there,

I am using the routing package of GoogleCP, which is doing quite
well.
I wanted to know if it is possible to monitor the evolution of the
objective function of the routing package.
I guess it is something like:

SearchMonitor* const monitor = (routing.solver())-
>MakeSearchLog(100000, THE_OBJECTIVE_VARIABLE);
routing.AddSearchMonitor(monitor);

but I do not know how to get the objective variable from the
RoutingModel .


Adding the flag  --routing_trace will do just that for you.
 
Also, is there a clean way to interrupt a search in such a way that
control is returned from the engine so that the current solution can
be queried? I know about setting the time limit, but I would prefer a
more interactive mechanism.

I guess you can create your custom search limit with Solver::MakeCustomLimit(), which will stop the search when your callback returns true.

Vincent
Reply all
Reply to author
Forward
0 new messages