15 #ifndef CORE_RANDOMIZED_RM_H_
16 #define CORE_RANDOMIZED_RM_H_
21 #include <parallel/algorithm>
32 template <
typename TBaseRm>
50 template <
typename TBaseRm>
52 : auto_randomize_(auto_randomize){};
55 template <
typename TBaseRm>
64 return std::numeric_limits<result_type>::max();
67 return random->
Integer(std::numeric_limits<result_type>::max());
71 template <
typename TBaseRm>
74 #pragma omp parallel for schedule(static, 1)
75 for (uint64_t n = 0; n < this->agents_.size(); ++n) {
77 __gnu_parallel::random_shuffle(this->agents_[n].begin(),
78 this->agents_[n].end());
81 std::shuffle(this->agents_[n].begin(), this->agents_[n].end(),
88 this->uid_ah_map_.Insert(a->
GetUid(), ah);
90 TBaseRm::ForEachAgentParallel(update_agent_map);
94 template <
typename TBaseRm>
96 TBaseRm::EndOfIteration();
97 if (auto_randomize_) {
98 RandomizeAgentsOrder();
104 #endif // CORE_RANDOMIZED_RM_H_