15 #ifndef PAAL_SINGLE_MINDED_AUCTIONS_HPP
16 #define PAAL_SINGLE_MINDED_AUCTIONS_HPP
22 #include <boost/range/iterator_range.hpp>
42 GetCopiesNum get_copies_num;
49 using value_t =
puretype(get_value(*std::begin(bidders)));
50 static_assert(std::is_arithmetic<value_t>::value,
51 "get_value return type is not arithmetic!");
52 auto&& bid_items = get_items(*std::begin(bidders));
53 using bundle_t =
puretype(bid_items);
54 static_assert(std::is_move_constructible<bundle_t>::value,
55 "bundle_t is not move constructible!");
56 static_assert(std::is_default_constructible<bundle_t>::value,
57 "bundle_t is not default constructible!");
58 BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<
59 decltype(bid_items)>));
67 template <
class B
idder>
68 auto operator()(
Bidder&& b)
103 GetCopiesNum get_copies_num = GetCopiesNum{}
106 std::forward<Bidders>(bidders),
107 std::forward<Items>(items),
113 BOOST_CONCEPT_ASSERT((concepts::single_minded<Bidders, Items, GetValue, GetItems, GetCopiesNum>));
115 std::forward<Bidders>(bidders),
116 std::forward<Items>(items),
153 GetCopiesNum get_copies_num = GetCopiesNum{}
156 std::forward<Bidders>(bidders),
157 std::forward<Items>(items),
163 BOOST_CONCEPT_ASSERT((concepts::single_minded<Bidders, Items, GetValue, GetItems, GetCopiesNum>));
165 std::forward<Bidders>(bidders),
166 std::forward<Items>(items),
200 GetCopiesNum get_copies_num = GetCopiesNum{}
203 std::forward<Bidders>(bidders),
204 std::forward<Items>(items),
210 BOOST_CONCEPT_ASSERT((concepts::single_minded<Bidders, Items, GetValue, GetItems, GetCopiesNum>));
212 std::forward<Bidders>(bidders),
213 std::forward<Items>(items),
232 template<
class B
idders,
class GetItems,
class OutputIterator>
236 std::forward<Bidders>(bidders),
245 #endif // PAAL_SINGLE_MINDED_AUCTIONS_HPP
auto make_singleton_range(Elem &&elem) -> decltype(boost::make_iterator_range(make_singleton_iterator_begin(std::forward< Elem >(elem)), make_singleton_iterator_end< Elem >()))
function to create a singleton range
auto make_single_minded_to_value_query_auction(Bidders &&bidders, Items &&items, GetValue get_value, GetItems get_items, GetCopiesNum get_copies_num=GetCopiesNum{}) -> decltype(make_xor_bids_to_value_query_auction(std::forward< Bidders >(bidders), std::forward< Items >(items), detail::get_bids(), get_value, get_items, get_copies_num))
detail
auto make_xor_bids_to_demand_query_auction(Bidders &&bidders, Items &&items, GetBids get_bids, GetValue get_value, GetItems get_items, GetCopiesNum get_copies_num=GetCopiesNum{})
detail
auto make_xor_bids_to_value_query_auction(Bidders &&bidders, Items &&items, GetBids get_bids, GetValue get_value, GetItems get_items, GetCopiesNum get_copies_num=GetCopiesNum{}) -> decltype(make_value_query_auction_components(std::forward< Bidders >(bidders), std::forward< Items >(items), detail::xor_bids_value_query< GetBids, GetValue, GetItems >(get_bids, get_value, get_items), get_copies_num))
detail
void extract_items_from_single_minded(Bidders &&bidders, GetItems get_items, OutputIterator output)
Extract all items appearing in all bidders' bids. This function doesn't eliminate duplicates...
std::string Bidder
[Demand Query Auction Components Example]
auto make_xor_bids_to_gamma_oracle_auction(Bidders &&bidders, Items &&items, GetBids get_bids, GetValue get_value, GetItems get_items, GetCopiesNum get_copies_num=GetCopiesNum{}) -> decltype(make_gamma_oracle_auction_components(std::forward< Bidders >(bidders), std::forward< Items >(items), detail::xor_bids_gamma_oracle< GetBids, GetValue, GetItems >(get_bids, get_value, get_items), 1, get_copies_num))
detail
Interfaces for creating auctions from xor bids valuations.
#define puretype(t)
for given expression returns its type with removed const and reference
This file contains set of simple useful functors or functor adapters.
void extract_items_from_xor_bids(Bidders &&bidders, GetBids get_bids, GetItems get_items, OutputIterator output)
extract all items appearing in all bids. This function doesn't eliminate duplicates, this is left out to the caller.
auto make_single_minded_to_demand_query_auction(Bidders &&bidders, Items &&items, GetValue get_value, GetItems get_items, GetCopiesNum get_copies_num=GetCopiesNum{}) -> decltype(make_xor_bids_to_demand_query_auction(std::forward< Bidders >(bidders), std::forward< Items >(items), detail::get_bids(), get_value, get_items, get_copies_num))
Create demand query auction from single minded valuations.
auto make_single_minded_to_gamma_oracle_auction(Bidders &&bidders, Items &&items, GetValue get_value, GetItems get_items, GetCopiesNum get_copies_num=GetCopiesNum{}) -> decltype(make_xor_bids_to_gamma_oracle_auction(std::forward< Bidders >(bidders), std::forward< Items >(items), detail::get_bids(), get_value, get_items, get_copies_num))
Create gamma oracle auction from single minded valuations.