Private prefix projection for a growing list. More...
#include <examples/common-pattern.hh>
Public Member Functions | |
| Actor * | copy (Space &home) override |
| Create copy. | |
| PropCost | cost (const Space &, const ModEventDelta &) const override |
| Cost function. | |
| void | reschedule (Space &home) override |
| Schedule function. | |
| ExecStatus | propagate (Space &home, const ModEventDelta &) override |
| Propagation function. | |
| size_t | dispose (Space &home) override |
| Delete actor and return its size. | |
| ModEventDelta | modeventdelta (void) const |
| Return the modification event delta. | |
| virtual ExecStatus | advise (Space &home, Advisor &a, const Delta &d) |
| Advise function. | |
| virtual void | advise (Space &home, Advisor &a) |
| Run advisor a to be run on failure in failed space. | |
| double | afc (void) const |
| Return the accumulated failure count. | |
| unsigned int | id (void) const |
| Return propagator id. | |
| PropagatorGroup | group (void) const |
| Return group propagator belongs to. | |
| void | group (PropagatorGroup g) |
| Add propagator to group g. | |
| bool | disabled (void) const |
| Whether propagator is currently disabled. | |
| virtual | ~Actor (void) |
| To avoid warnings. | |
Static Public Member Functions | |
| static void | post (Home home, OpenViewList< Int::IntView > pattern, const Database &database, int support, IntVar count) |
| static void * | operator new (size_t s, Space &home) |
| Allocate memory from space. | |
| static void | operator delete (void *p, Space &home) |
| No-op for exceptions. | |
| static void * | operator new (size_t s) |
| Not used. | |
| static void | operator delete (void *p) |
| Not used. | |
Protected Member Functions | |
| OpenProjection (Home home, OpenViewList< Int::IntView > pattern, const Database &database, int support, IntVar count) | |
| OpenProjection (Space &home, OpenProjection &p) | |
| Protected Member Functions inherited from Gecode::Propagator | |
| Propagator (Home home) | |
| Constructor for posting. | |
| Propagator (Space &home, Propagator &p) | |
| Constructor for cloning p. | |
| Propagator * | fwd (void) const |
| Return forwarding pointer during copying. | |
| Kernel::GPI::Info & | gpi (void) |
| Provide access to propagator information. | |
Protected Attributes | |
| OpenViewList< Int::IntView > | list |
| Int::IntView | length |
| Int::IntView | frequency |
| Projection | projection |
| IntSet | frequent_items |
| int | consumed |
| int | subscribed |
| int | cached_prefix |
| Prefix length at which the item filter and length bound were computed. | |
Detailed Description
Private prefix projection for a growing list.
Adapts ProjectSDB (Algorithm 1) and Filter-Prefix-Projection (Algorithm 2) from "PREFIX-PROJECTION Global Constraint for Sequential Pattern Mining", Amina Kemmar, Samir Loudni, Yahia Lebbah, Patrice Boizumault, and Thierry Charnois, CP 2015, https://doi.org/10.1007/978-3-319-23219-5_17
The open list replaces the termination marker. Suffix lengths bound how many more items can follow the assigned prefix. The projection advances only through the leading assigned positions. Items frequent in the supporting suffixes filter every materialized position after that prefix. Adding positions reuses the cached items and suffix-length bound until the assigned prefix grows.
The support variable is bounded by the prefix's supporting-record count and becomes exact once the list is closed and fully assigned.
Definition at line 319 of file common-pattern.hh.
Constructor & Destructor Documentation
◆ OpenProjection() [1/2]
|
inlineprotected |
Definition at line 331 of file common-pattern.hh.
◆ OpenProjection() [2/2]
|
inlineprotected |
Definition at line 344 of file common-pattern.hh.
Member Function Documentation
◆ copy()
◆ cost()
|
inlineoverridevirtual |
◆ reschedule()
|
inlineoverridevirtual |
Schedule function.
The function is executed when a propagator is enabled again. Note that a propagator should be scheduled with the right modification event delta and should only be scheduled if it is legal to execute the propagator.
Implements Gecode::Propagator.
Definition at line 363 of file common-pattern.hh.
◆ propagate()
|
inlineoverridevirtual |
Propagation function.
The propagation function must return an execution status as follows:
- ES_FAILED: the propagator has detected failure
- ES_NOFIX: the propagator has done propagation
- ES_FIX: the propagator has done propagation and has computed a fixpoint. That is, running the propagator immediately again will do nothing.
Apart from the above values, a propagator can return the result from calling one of the functions defined by a space:
- ES_SUBSUMED: the propagator is subsumed and has been already deleted.
- ES_NOFIX_PARTIAL: the propagator has consumed some of its propagation events.
- ES_FIX_PARTIAL: the propagator has consumed some of its propagation events and with respect to these events is at fixpoint For more details, see the individual functions.
Implements Gecode::Propagator.
Definition at line 371 of file common-pattern.hh.
◆ dispose()
|
inlineoverridevirtual |
Delete actor and return its size.
Reimplemented from Gecode::Actor.
Definition at line 417 of file common-pattern.hh.
◆ post()
|
inlinestatic |
Definition at line 432 of file common-pattern.hh.
Member Data Documentation
◆ list
|
protected |
Definition at line 321 of file common-pattern.hh.
◆ length
|
protected |
Definition at line 322 of file common-pattern.hh.
◆ frequency
|
protected |
Definition at line 323 of file common-pattern.hh.
◆ projection
|
protected |
Definition at line 324 of file common-pattern.hh.
◆ frequent_items
|
protected |
Definition at line 325 of file common-pattern.hh.
◆ consumed
|
protected |
Definition at line 326 of file common-pattern.hh.
◆ subscribed
|
protected |
Definition at line 327 of file common-pattern.hh.
◆ cached_prefix
|
protected |
Prefix length at which the item filter and length bound were computed.
Definition at line 329 of file common-pattern.hh.
The documentation for this class was generated from the following file:
- examples/common-pattern.hh
