Gecode::Int::BinPacking::Pack Class Reference
Other available functionality » Integer propagators

Bin-packing propagator. More...

`#include <bin-packing.hh>`

## Public Member Functions

template<class SizeSet>
bool | nosum (const SizeSet &s, int a, int b, int &ap, int &bp)
| Detect non-existence of sums in a .. b.
template<class SizeSet>
bool | nosum (const SizeSet &s, int a, int b)
| Detect non-existence of sums in a .. b.
virtual ExecStatus | propagate (Space &home, const ModEventDelta &med)
| Perform propagation.
virtual PropCost | cost (const Space &home, const ModEventDelta &med) const
| Cost function.
virtual void | reschedule (Space &home)
| Schedule function.
virtual Actor * | copy (Space &home)
| Copy propagator during cloning.
virtual size_t | dispose (Space &home)
| Destructor.
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 accumlated 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 ExecStatus | post (Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
| Post propagator for loads l and items bs.
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

| Pack (Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
| Constructor for posting.
| Pack (Space &home, Pack &p)
| Constructor for cloning 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 global propagator information.

## Protected Attributes

ViewArray< OffsetView > | l
| Views for load of bins.
ViewArray< Item > | bs
| Items with bin and size.
int | t
| Total size of all items.

## Detailed Description

Bin-packing propagator.

The algorithm is taken from: Paul Shaw. A Constraint for Bin Packing. CP 2004.

Requires

#include <gecode/int/bin-packing.hh>
bin-packing.hh

Definition at line 141 of file bin-packing.hh.

## Constructor & Destructor Documentation

## Pack() [1/2]

Gecode::Int::BinPacking::Pack::Pack | ( | Home | home,
|  | ViewArray< OffsetView > & | l,
|  | ViewArray< Item > & | bs )

inline protected

Constructor for posting.

Definition at line 150 of file propagate.hpp.

## Pack() [2/2]

Gecode::Int::BinPacking::Pack::Pack | ( | Space & | home,
|  | Pack & | p )

inline protected

Constructor for cloning p.

Definition at line 159 of file propagate.hpp.

## Member Function Documentation

## post()

ExecStatus Gecode::Int::BinPacking::Pack::post | ( | Home | home,
|  | ViewArray< OffsetView > & | l,
|  | ViewArray< Item > & | bs )

static

Post propagator for loads l and items bs.

Definition at line 360 of file propagate.cpp.

## nosum() [1/2]

template<class SizeSet>

bool Gecode::Int::BinPacking::Pack::nosum | ( | const SizeSet & | s,
|  | int | a,
|  | int | b,
|  | int & | ap,
|  | int & | bp )

inline

Detect non-existence of sums in a .. b.

Definition at line 175 of file propagate.hpp.

## nosum() [2/2]

template<class SizeSet>

bool Gecode::Int::BinPacking::Pack::nosum | ( | const SizeSet & | s,
|  | int | a,
|  | int | b )

inline

Detect non-existence of sums in a .. b.

Definition at line 206 of file propagate.hpp.

## propagate()

ExecStatus Gecode::Int::BinPacking::Pack::propagate | ( | Space & | home,
|  | const ModEventDelta & | med )

virtual

Perform propagation.

Implements Gecode::Propagator.

Definition at line 113 of file propagate.cpp.

## cost()

PropCost Gecode::Int::BinPacking::Pack::cost | ( | const Space & | home,
|  | const ModEventDelta & | med ) const

virtual

Cost function.

Implements Gecode::Propagator.

Definition at line 44 of file propagate.cpp.

## reschedule()

void Gecode::Int::BinPacking::Pack::reschedule | ( | Space & | home | ) |

virtual

Schedule function.

Implements Gecode::Propagator.

Definition at line 49 of file propagate.cpp.

## copy()

Actor * Gecode::Int::BinPacking::Pack::copy | ( | Space & | home | ) |

virtual

Copy propagator during cloning.

Implements Gecode::Actor.

Definition at line 55 of file propagate.cpp.

## dispose()

size_t Gecode::Int::BinPacking::Pack::dispose | ( | Space & | home | ) |

inline virtual

Destructor.

Reimplemented from Gecode::Actor.

Definition at line 166 of file propagate.hpp.

## Member Data Documentation

## l

ViewArray<OffsetView> Gecode::Int::BinPacking::Pack::l

protected

Views for load of bins.

Definition at line 144 of file bin-packing.hh.

## bs

ViewArray<Item> Gecode::Int::BinPacking::Pack::bs

protected

Items with bin and size.

Definition at line 146 of file bin-packing.hh.

## t

int Gecode::Int::BinPacking::Pack::t

protected

Total size of all items.

Definition at line 148 of file bin-packing.hh.

The documentation for this class was generated from the following files:

- gecode/int/bin-packing.hh
- gecode/int/bin-packing/propagate.cpp
- gecode/int/bin-packing/propagate.hpp