All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands > Class Template Reference

This class is assigning vertices demands to capacitated generators in such a way that the total cost is minimized. The solution is based on the min cost max flow algorithm. More...

#include <capacitated_voronoi.hpp>

Classes

class  Dist
 this class store as a distance: More...
 

Public Types

typedef Dist::DistI DistI
 
typedef metric_traits< Metric >
::VertexType 
VertexType
 
typedef std::set< VertexType > Generators
 
typedef std::vector< VertexType > Vertices
 

Public Member Functions

 capacitated_voronoi (const Generators &gen, Vertices ver, const Metric &m, const GeneratorsCapacieties &gc, const VerticesDemands &vd, DistI costOfNoGenerator=std::numeric_limits< DistI >::max())
 constructor More...
 
 capacitated_voronoi (const capacitated_voronoi &other)
 copy constructor is not default because of rev graph property More...
 
Dist add_generator (VertexType gen)
 returns diff between new cost and old cost
 
Dist rem_generator (VertexType gen)
 returns diff between new cost and old cost
 
const Generators & get_generators () const
 getter for generators More...
 
const Vertices & get_vertices () const
 getter for vertices More...
 
boost::iterator_range
< VForGenerator > 
get_vertices_for_generator (VertexType gen) const
 member function for getting assignment, for generator. More...
 
Dist get_cost () const
 get total cost of the assignment More...
 

Friends

template<typename OStream >
OStream & operator<< (OStream &s, capacitated_voronoi &v)
 operator<< More...
 

Detailed Description

template<typename Metric, typename GeneratorsCapacieties, typename VerticesDemands>
class paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >

This class is assigning vertices demands to capacitated generators in such a way that the total cost is minimized. The solution is based on the min cost max flow algorithm.

Template Parameters
Metric
GeneratorsCapacietiesis a functor which for each Generator returns its capacity .
VerticesDemandsis a functor which for each vertex returns its demand.

Definition at line 47 of file capacitated_voronoi.hpp.

Constructor & Destructor Documentation

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >::capacitated_voronoi ( const Generators &  gen,
Vertices  ver,
const Metric &  m,
const GeneratorsCapacieties &  gc,
const VerticesDemands &  vd,
DistI  costOfNoGenerator = std::numeric_limits<DistI>::max() 
)
inline

constructor

Parameters
gen
ver
m
gc
vd
costOfNoGenerator

Definition at line 233 of file capacitated_voronoi.hpp.

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >::capacitated_voronoi ( const capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands > &  other)
inline

copy constructor is not default because of rev graph property

Parameters
other

Definition at line 257 of file capacitated_voronoi.hpp.

Member Function Documentation

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
Dist paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >::get_cost ( ) const
inline

get total cost of the assignment

Returns

Definition at line 367 of file capacitated_voronoi.hpp.

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
const Generators& paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >::get_generators ( ) const
inline

getter for generators

Returns

Definition at line 335 of file capacitated_voronoi.hpp.

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
const Vertices& paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >::get_vertices ( ) const
inline

getter for vertices

Returns

Definition at line 342 of file capacitated_voronoi.hpp.

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
boost::iterator_range<VForGenerator> paal::data_structures::capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands >::get_vertices_for_generator ( VertexType  gen) const
inline

member function for getting assignment, for generator.

Returns
returns range of pairs; the first element of pair is the Vertex and the second element is the flow from this vertex to given generator

Definition at line 352 of file capacitated_voronoi.hpp.

Friends And Related Function Documentation

template<typename Metric , typename GeneratorsCapacieties , typename VerticesDemands >
template<typename OStream >
OStream& operator<< ( OStream &  s,
capacitated_voronoi< Metric, GeneratorsCapacieties, VerticesDemands > &  v 
)
friend

operator<<

Template Parameters
OStream
Parameters
s
v
Returns

Definition at line 388 of file capacitated_voronoi.hpp.


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