FireSTARR
Loading...
Searching...
No Matches
EventCompare.h
1/* Copyright (c) Queen's Printer for Ontario, 2020. */
2/* Copyright (c) His Majesty the King in Right of Canada as represented by the Minister of Natural Resources, 2025. */
3
4/* SPDX-License-Identifier: AGPL-3.0-or-later */
5
6#pragma once
7#include "Event.h"
8namespace fs::sim
9{
14{
21 [[nodiscard]] constexpr bool operator()(const Event& x, const Event& y) const
22 {
23 if (x.time() == y.time())
24 {
25 if (x.type() == y.type())
26 {
27 return x.cell().hash() < y.cell().hash();
28 }
29 return x.type() < y.type();
30 }
31 return x.time() < y.time();
32 }
33};
34}
A specific Event scheduled in a specific Scenario.
Definition Event.h:19
constexpr DurationSize time() const
Time of Event (decimal days)
Definition Event.h:176
constexpr const Cell & cell() const
Cell Event takes place in.
Definition Event.h:224
constexpr Type type() const
Type of Event.
Definition Event.h:184
constexpr HashSize hash() const noexcept
Hash derived from row and column.
Definition Location.h:80
Defines how Events are compared for sorting.
Definition EventCompare.h:14
constexpr bool operator()(const Event &x, const Event &y) const
Defines ordering on Events.
Definition EventCompare.h:21