Generated on Sat Feb 7 2015 02:01:45 for Gecode by doxygen 1.8.9.1
Gecode::Int::BinPacking::Pack Class Reference

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. More...
 
template<class SizeSet >
bool nosum (const SizeSet &s, int a, int b)
 Detect non-existence of sums in a .. b. More...
 
virtual ExecStatus propagate (Space &home, const ModEventDelta &med)
 Perform propagation. More...
 
virtual PropCost cost (const Space &home, const ModEventDelta &med) const
 Cost function. More...
 
virtual Actorcopy (Space &home, bool share)
 Copy propagator during cloning. More...
 
virtual size_t dispose (Space &home)
 Destructor. More...
 
- Public Member Functions inherited from Gecode::Propagator
ModEventDelta modeventdelta (void) const
 Return the modification event delta. More...
 
virtual ExecStatus advise (Space &home, Advisor &a, const Delta &d)
 Advise function. More...
 
double afc (const Space &home) const
 Return the accumlated failure count. More...
 
- Public Member Functions inherited from Gecode::Actor

Static Public Member Functions

static ExecStatus post (Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
 Post propagator for loads l and items bs. More...
 
- Static Public Member Functions inherited from Gecode::Actor
static void * operator new (size_t s, Space &home)
 Allocate memory from space. More...
 
static void operator delete (void *p, Space &home)
 No-op for exceptions. More...
 

Protected Member Functions

 Pack (Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
 Constructor for posting. More...
 
 Pack (Space &home, bool share, Pack &p)
 Constructor for cloning p. More...
 
- Protected Member Functions inherited from Gecode::Propagator
 Propagator (Home home)
 Constructor for posting. More...
 
 Propagator (Space &home, bool share, Propagator &p)
 Constructor for cloning p. More...
 
Propagatorfwd (void) const
 Return forwarding pointer during copying. More...
 

Protected Attributes

ViewArray< OffsetViewl
 Views for load of bins. More...
 
ViewArray< Itembs
 Items with bin and size. More...
 
int t
 Total size of all items. More...
 

Detailed Description

Bin-packing propagator.

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

Requires

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

Constructor & Destructor Documentation

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

Constructor for posting.

Definition at line 155 of file propagate.hpp.

Gecode::Int::BinPacking::Pack::Pack ( Space home,
bool  share,
Pack p 
)
inlineprotected

Constructor for cloning p.

Definition at line 164 of file propagate.hpp.

Member Function Documentation

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 358 of file propagate.cpp.

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 180 of file propagate.hpp.

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 211 of file propagate.hpp.

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

Perform propagation.

Implements Gecode::Propagator.

Definition at line 111 of file propagate.cpp.

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

Cost function.

Implements Gecode::Propagator.

Definition at line 48 of file propagate.cpp.

Actor * Gecode::Int::BinPacking::Pack::copy ( Space home,
bool  share 
)
virtual

Copy propagator during cloning.

Implements Gecode::Actor.

Definition at line 53 of file propagate.cpp.

size_t Gecode::Int::BinPacking::Pack::dispose ( Space home)
inlinevirtual

Destructor.

Reimplemented from Gecode::Actor.

Definition at line 171 of file propagate.hpp.

Member Data Documentation

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

Views for load of bins.

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

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

Items with bin and size.

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

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

Total size of all items.

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


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