MultiAgentDecisionProcess
FixedCapacityPriorityQueue< T, _Compare > Class Template Reference

FixedCapacityPriorityQueue is a class that represents a priority queue with a fixed size. More...

#include <FixedCapacityPriorityQueue.h>

Inheritance diagram for FixedCapacityPriorityQueue< T, _Compare >:
[legend]

Public Member Functions

const T & back () const
 
bool empty () const
 
 FixedCapacityPriorityQueue (size_t capacity)
 (default) Constructor More...
 
bool insert (T &a, T &overflown_T)
 inserts a in the priority q. More...
 
void pop ()
 
size_t size () const
 
std::string SoftPrint () const
 
const T & top () const
 

Private Attributes

size_t _m_capacity
 
std::list< T > _m_l
 

Detailed Description

template<typename T, typename _Compare = std::less<T>>
class FixedCapacityPriorityQueue< T, _Compare >

FixedCapacityPriorityQueue is a class that represents a priority queue with a fixed size.

-all overflowed items (i.e., items that do not fit) are returned, such that the user can delete them

Constructor & Destructor Documentation

template<typename T, typename _Compare = std::less<T>>
FixedCapacityPriorityQueue< T, _Compare >::FixedCapacityPriorityQueue ( size_t  capacity)
inline

(default) Constructor

Member Function Documentation

template<typename T, typename _Compare = std::less<T>>
const T& FixedCapacityPriorityQueue< T, _Compare >::back ( ) const
inline
template<typename T, typename _Compare >
bool FixedCapacityPriorityQueue< T, _Compare >::insert ( T &  a,
T &  overflown_T 
)

inserts a in the priority q.

returns true if the capacity overflows in this case, overflown_T is set to the overflown value (which can then be recovered or deleted by the user).

Referenced by BGIPSolution::AddSolution(), Problem_CGBG_FF::AssignAgentActionsToHouses(), and Problem_CGBG_FF::AssignAgentTypesToHouses().

template<typename T, typename _Compare = std::less<T>>
size_t FixedCapacityPriorityQueue< T, _Compare >::size ( ) const
inline
template<typename T, typename _Compare = std::less<T>>
std::string FixedCapacityPriorityQueue< T, _Compare >::SoftPrint ( ) const
inline

Referenced by BGIPSolution::SoftPrint().

Member Data Documentation

template<typename T, typename _Compare = std::less<T>>
size_t FixedCapacityPriorityQueue< T, _Compare >::_m_capacity
private
template<typename T, typename _Compare = std::less<T>>
std::list<T> FixedCapacityPriorityQueue< T, _Compare >::_m_l
private