17#ifndef DAISI_CPPS_LOGICAL_ALGORITHMS_ASSIGNMENT_AUCTION_INITIATOR_STATE_H_
18#define DAISI_CPPS_LOGICAL_ALGORITHMS_ASSIGNMENT_AUCTION_INITIATOR_STATE_H_
22#include "cpps/amr/model/amr_static_ability.h"
23#include "cpps/logical/message/auction_based/bid_submission.h"
24#include "cpps/logical/message/auction_based/winner_response.h"
25#include "layered_precedence_graph.h"
26#include "material_flow/model/material_flow.h"
36 std::string task_uuid;
37 std::string winner_connection;
38 daisi::util::Duration latest_finish_time;
78 static void removeBidsForTask(std::vector<BidSubmission> &bid_submissions,
79 const std::string &task_uuid);
86 static void removeBidsForWinner(std::vector<BidSubmission> &bid_submissions,
87 const std::string &task_uuid,
88 const std::string &winner_connection);
94 static void removeBidsWhichMeetAbilityRequirement(
95 std::vector<BidSubmission> &bid_submissions,
99 std::vector<BidSubmission> bid_submissions_;
103 std::vector<WinnerResponse> winner_acceptions_;
106 std::shared_ptr<LayeredPrecedenceGraph> layered_precedence_graph_;
109 uint8_t no_bid_submissions_counter_ = 0;
112 uint8_t no_winner_acceptions_counter_ = 0;
Definition amr_static_ability.h:32
Helper class for the IteratedAuctionAssignmentInitiator to handle and store the state of received bid...
Definition auction_initiator_state.h:32
void countWinnerResponseProcessing()
Counting how many times winner responses were successful or not. Throwing an exception if there were ...
Definition auction_initiator_state.cpp:80
void clearIterationInfo()
Clearing all information from the internal state.
Definition auction_initiator_state.cpp:132
void countBidSubmissionProcessing()
Counting how many times bid submissions were successful or not. Throwing an exception if there were n...
Definition auction_initiator_state.cpp:90
void addWinnerResponse(const WinnerResponse &winner_response)
Adding a received WinnerResponse message to the internal state if it was successful.
Definition auction_initiator_state.cpp:29
void clearWinnerAcceptions()
Clearing winner acceptions from the internal state.
Definition auction_initiator_state.cpp:137
std::vector< Winner > selectWinner() const
Calculating winners for the different ability groups based on received bids.
Definition auction_initiator_state.cpp:100
std::vector< daisi::material_flow::Task > processWinnerAcceptions()
Processing each successful winner response and removing related bids.
Definition auction_initiator_state.cpp:66
void addBidSubmission(const BidSubmission &bid_submission)
Adding a received BidSubmission message to the internal state.
Definition auction_initiator_state.cpp:25
Definition bid_submission.h:30
Definition winner_response.h:28
Modified Round Robin Algorithm that centrally assigns tasks of incoming material flows to the corresp...
Definition algorithm_config.h:22
Helper struct to store information needed to send WinnerNotifications.
Definition auction_initiator_state.h:35