[ library(gfd) | Reference Manual | Alphabetic Index ]

gfd_update

Update the parent Gecode space to the current state.

Description

This is a low-level primitive that updates (if needed) the parent cloned Gecode space to the current state. The parent clone is from where recomputation is performed, so updating the parent will reduce the amount of recomputation done during subsequent backtracking. Note that the old parent is discarded and replaced by the updated parent if possible.

GFD handles the cloning of Gecode spaces automatically, and the user does not normally have to deal with cloning explicitly. However, if the cloning distance is set very high, so that the system does mostly recomputation instead of copying from clones, it is possible for GFD performance to suffer significantly if the changes to set-up a problem before the search has to be recomputed. This problem does not occur in Gecode when using Gecode's search engine, because the space is always cloned before the start of the search. As the search in ECLiPSe is not normally distinguished from the model setup, GFD cannot automatically ensure that the space is cloned before the start of search (if the search is performed in ECLiPSe).

The update is only done if the current state is different from the parent's, and the current Gecode state is stable (i.e. fully propagated). If the computation since the parent is deterministic, the old parent will be discarded and replaced by the new parent.

The intended use for this predicate is just before the search starts in the user's program, if the search is performed in ECLiPSe. Note that gfd_update is included in GFD's labeling/1 and labeling/3, and so if you use these, you do not need to use gfd_update. Also, this predicate will only be useful if the cloning distance is set very high, and with default settings it should not be needed.