10 #include "container_iterator.h"
11 #include "slot_ranking.h"
31 std::string _model_id;
32 slot_ranking _slot_impl;
67 size_t& action_id,
api_status* status =
nullptr)
const;
94 void push_back(
const size_t action_id,
const float prob);
158 using iterator = slot_ranking::iterator;
159 using const_iterator = slot_ranking::const_iterator;
166 const_iterator
end() const;
Report status of all API calls.
Definition: api_status.h:22
choose_rank() returns the action choice using ranking_response. ranking_response contains all the act...
Definition: ranking_response.h:29
void clear()
Clear the ranking response object so that it can be reused. The goal is to reuse response without rea...
const_iterator begin() const
Returns an iterator pointing to the first element of the (action, probability) collection.
size_t size() const
Size of the action collection.
ranking_response(char const *event_id)
Construct a new ranking response object.
const char * get_model_id() const
Get the model_id. Every rank call (single or multi slot) is associated with a unique model used to pr...
void set_event_id(const char *event_id)
Set the event_id. (This is set internally by the API)
int set_chosen_action_id(size_t action_id, api_status *status=nullptr)
Set the chosen action id. (This is set internally by the API)
void push_back(const size_t action_id, const float prob)
Add (action id, probability) pair to the slot (This is set internally by the API)
void set_model_id(std::string &&model_id)
Set the model_id. Every rank call is associated with a unique model used to predict....
ranking_response(ranking_response &&) noexcept
Move construct a new ranking response object. The underlying data is taken from the rvalue reference.
int get_chosen_action_id(size_t &action_id, api_status *status=nullptr) const
Get the chosen action id.
const_iterator end() const
Returns an iterator referring to the past-the-end element of the (action, probability) collection.
int set_chosen_action_id_unchecked(size_t action_id, api_status *status=nullptr)
Set the chosen action id, but do not verify the index fits within the ranking. (This is set internall...
void set_model_id(const char *model_id)
Set the model_id. Every rank call is associated with a unique model used to predict....
const char * get_event_id() const
Unique event_id for this ranking request. This event_id must be used when calling report_outcome so i...
[Error Generator]
Definition: live_model.h:25