AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
fifo_open_list.h
1#ifndef PROBFD_OPEN_LISTS_FIFO_OPEN_LIST_H
2#define PROBFD_OPEN_LISTS_FIFO_OPEN_LIST_H
3
4#include "probfd/algorithms/open_list.h"
5
6#include <deque>
7
10
11template <typename Action>
12class FifoOpenList : public algorithms::OpenList<Action> {
13 std::deque<StateID> queue_;
14
15public:
16 [[nodiscard]]
17 bool empty() const override
18 {
19 return queue_.empty();
20 }
21
22 [[nodiscard]]
23 unsigned size() const override
24 {
25 return queue_.size();
26 }
27
28 StateID pop() override
29 {
30 StateID s = queue_.front();
31 queue_.pop_front();
32 return s;
33 }
34
35 void push(StateID state_id) override { queue_.push_back(state_id); }
36
37 void clear() override { queue_.clear(); }
38};
39
40} // namespace probfd::open_lists
41
42#endif // PROBFD_OPEN_LISTS_FIFO_OPEN_LIST_H
An interface for open lists used during search algorithms.
Definition trap_aware_dfhs.h:21
This namespace contains implementations of open lists.
Definition fifo_open_list.h:9
A StateID represents a state within a StateIDMap. Just like Fast Downward's StateID type,...
Definition types.h:22