mirror of
https://github.com/JHUAPL/kami.git
synced 2026-01-09 14:58:02 -05:00
Remove "maybe unused" as that is not helping
This commit is contained in:
@@ -49,14 +49,14 @@ std::shared_ptr<std::ranlux24> rng = nullptr;
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<kami::AgentID> : fmt::formatter<std::string> {
|
struct fmt::formatter<kami::AgentID> : fmt::formatter<std::string> {
|
||||||
[[maybe_unused]] static auto format(kami::AgentID agent_id, format_context &ctx) {
|
static auto format(kami::AgentID agent_id, format_context &ctx) {
|
||||||
return format_to(ctx.out(), "{}", agent_id.to_string());
|
return format_to(ctx.out(), "{}", agent_id.to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<kami::GridCoord1D> : fmt::formatter<std::string> {
|
struct fmt::formatter<kami::GridCoord1D> : fmt::formatter<std::string> {
|
||||||
[[maybe_unused]] static auto format(const kami::GridCoord1D& coord, format_context &ctx) {
|
static auto format(const kami::GridCoord1D& coord, format_context &ctx) {
|
||||||
return format_to(ctx.out(), "{}", coord.to_string());
|
return format_to(ctx.out(), "{}", coord.to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,14 +48,14 @@ std::shared_ptr<std::ranlux24> rng = nullptr;
|
|||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<kami::AgentID> : fmt::formatter<std::string> {
|
struct fmt::formatter<kami::AgentID> : fmt::formatter<std::string> {
|
||||||
[[maybe_unused]] static auto format(kami::AgentID agent_id, format_context &ctx) {
|
static auto format(kami::AgentID agent_id, format_context &ctx) {
|
||||||
return format_to(ctx.out(), "{}", agent_id.to_string());
|
return format_to(ctx.out(), "{}", agent_id.to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<kami::GridCoord2D> : fmt::formatter<std::string> {
|
struct fmt::formatter<kami::GridCoord2D> : fmt::formatter<std::string> {
|
||||||
[[maybe_unused]] static auto format(const kami::GridCoord2D& coord, format_context &ctx) {
|
static auto format(const kami::GridCoord2D& coord, format_context &ctx) {
|
||||||
return format_to(ctx.out(), "{}", coord.to_string());
|
return format_to(ctx.out(), "{}", coord.to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace kami {
|
|||||||
* @details Moore neighborhood types include diagonally-adjacent cells as
|
* @details Moore neighborhood types include diagonally-adjacent cells as
|
||||||
* neighbors.
|
* neighbors.
|
||||||
*/
|
*/
|
||||||
Moore [[maybe_unused]],
|
Moore,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Von Neumann neighborhood
|
* @brief Von Neumann neighborhood
|
||||||
@@ -57,7 +57,7 @@ namespace kami {
|
|||||||
* @details Von Neumann neighborhood types do not include
|
* @details Von Neumann neighborhood types do not include
|
||||||
* diagonally-adjacent cells as neighbors.
|
* diagonally-adjacent cells as neighbors.
|
||||||
*/
|
*/
|
||||||
VonNeumann [[maybe_unused]]
|
VonNeumann
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +71,7 @@ namespace kami {
|
|||||||
* connecting two points. This is commonly called a "beeline" or
|
* connecting two points. This is commonly called a "beeline" or
|
||||||
* "as the crow flies."
|
* "as the crow flies."
|
||||||
*/
|
*/
|
||||||
Euclidean [[maybe_unused]],
|
Euclidean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Manhattan distance.
|
* @brief Manhattan distance.
|
||||||
@@ -81,7 +81,7 @@ namespace kami {
|
|||||||
* "taxicab distance," "rectilinear distance," or many other [formal
|
* "taxicab distance," "rectilinear distance," or many other [formal
|
||||||
* names](https://en.wikipedia.org/wiki/Taxicab_geometry).
|
* names](https://en.wikipedia.org/wiki/Taxicab_geometry).
|
||||||
*/
|
*/
|
||||||
Manhattan [[maybe_unused]]
|
Manhattan
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @returns false if the agent is not removed, otherwise, true.
|
* @returns false if the agent is not removed, otherwise, true.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[maybe_unused]] bool delete_agent(AgentID agent_id);
|
bool delete_agent(AgentID agent_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove agent from the grid at the specified location
|
* Remove agent from the grid at the specified location
|
||||||
@@ -184,7 +184,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @return true if the grid wraps, and false otherwise
|
* @return true if the grid wraps, and false otherwise
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[maybe_unused]] [[nodiscard]] bool get_wrap_x() const;
|
[[nodiscard]] bool get_wrap_x() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the neighborhood of the specified Agent
|
* Return the neighborhood of the specified Agent
|
||||||
@@ -215,7 +215,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @return the length of the grid in the `x` dimension
|
* @return the length of the grid in the `x` dimension
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[nodiscard]] unsigned int get_maximum_x() const;
|
[[nodiscard]] unsigned int get_maximum_x() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @returns false if the agent is not removed, otherwise, true.
|
* @returns false if the agent is not removed, otherwise, true.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] bool delete_agent(AgentID agent_id);
|
bool delete_agent(AgentID agent_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove agent from the grid at the specified location
|
* Remove agent from the grid at the specified location
|
||||||
@@ -195,14 +195,14 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @return true if the grid wraps, and false otherwise
|
* @return true if the grid wraps, and false otherwise
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[nodiscard]] bool get_wrap_x() const;
|
[[nodiscard]] bool get_wrap_x() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inquire to whether the grid wraps in the `y` dimension.
|
* Inquire to whether the grid wraps in the `y` dimension.
|
||||||
*
|
*
|
||||||
* @return true if the grid wraps, and false otherwise
|
* @return true if the grid wraps, and false otherwise
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[nodiscard]] bool get_wrap_y() const;
|
[[nodiscard]] bool get_wrap_y() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the neighborhood of the specified Agent
|
* Return the neighborhood of the specified Agent
|
||||||
@@ -239,14 +239,14 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @return the length of the grid in the `x` dimension
|
* @return the length of the grid in the `x` dimension
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[nodiscard]] unsigned int get_maximum_x() const;
|
[[nodiscard]] unsigned int get_maximum_x() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the size of the grid in the `y` dimension.
|
* Get the size of the grid in the `y` dimension.
|
||||||
*
|
*
|
||||||
* @return the length of the grid in the `xy dimension
|
* @return the length of the grid in the `xy dimension
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] [[nodiscard]] unsigned int get_maximum_y() const;
|
[[nodiscard]] unsigned int get_maximum_y() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace kami {
|
|||||||
class Population;
|
class Population;
|
||||||
class Scheduler;
|
class Scheduler;
|
||||||
|
|
||||||
[[maybe_unused]] inline semver::version get_version() { return version; }
|
inline semver::version get_version() { return version; }
|
||||||
|
|
||||||
} // namespace kami
|
} // namespace kami
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @param[in] n the number of time steps to execute.
|
* @param[in] n the number of time steps to execute.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] virtual void run(unsigned int n) = 0;
|
virtual void run(unsigned int n) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a single time-step for the model.
|
* Execute a single time-step for the model.
|
||||||
@@ -66,7 +66,7 @@ namespace kami {
|
|||||||
/**
|
/**
|
||||||
* @brief Get the `Domain` associated with this model
|
* @brief Get the `Domain` associated with this model
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] std::shared_ptr<Domain> get_domain();
|
std::shared_ptr<Domain> get_domain();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a `Domain` to this scheduler
|
* @brief Add a `Domain` to this scheduler
|
||||||
@@ -74,7 +74,7 @@ namespace kami {
|
|||||||
* @details This method will associate a model with the
|
* @details This method will associate a model with the
|
||||||
* scheduler.
|
* scheduler.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] void set_domain(std::shared_ptr<Domain> domain);
|
void set_domain(std::shared_ptr<Domain> domain);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the `Population` associated with this model
|
* @brief Get the `Population` associated with this model
|
||||||
@@ -87,12 +87,12 @@ namespace kami {
|
|||||||
* @details This method will associate a model with the
|
* @details This method will associate a model with the
|
||||||
* scheduler.
|
* scheduler.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] void set_population(std::shared_ptr<Population> population);
|
void set_population(std::shared_ptr<Population> population);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the `Scheduler` associated with this model
|
* @brief Get the `Scheduler` associated with this model
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] std::shared_ptr<Scheduler> get_scheduler();
|
std::shared_ptr<Scheduler> get_scheduler();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a `Model` to this scheduler
|
* @brief Add a `Model` to this scheduler
|
||||||
@@ -100,7 +100,7 @@ namespace kami {
|
|||||||
* @details This method will associate a model with the
|
* @details This method will associate a model with the
|
||||||
* scheduler.
|
* scheduler.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] void set_scheduler(std::shared_ptr<Scheduler> scheduler);
|
void set_scheduler(std::shared_ptr<Scheduler> scheduler);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace kami
|
} // namespace kami
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @param agent_id The AgentID of the agent to remove.
|
* @param agent_id The AgentID of the agent to remove.
|
||||||
*/
|
*/
|
||||||
[[maybe_unused]] void delete_agent(AgentID agent_id);
|
void delete_agent(AgentID agent_id);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the agent list.
|
* Returns the agent list.
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace kami {
|
|||||||
*
|
*
|
||||||
* @note First create a Model for the scheduler to live in.
|
* @note First create a Model for the scheduler to live in.
|
||||||
*/
|
*/
|
||||||
class LIBKAMI_EXPORT [[maybe_unused]] StagedScheduler : public SequentialScheduler {
|
class LIBKAMI_EXPORT StagedScheduler : public SequentialScheduler {
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief Advance a single time step.
|
* @brief Advance a single time step.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace kami {
|
|||||||
delete[] _agent_grid;
|
delete[] _agent_grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] bool Grid1D::delete_agent(AgentID agent_id) {
|
bool Grid1D::delete_agent(AgentID agent_id) {
|
||||||
GridCoord1D coord = get_location_by_agent(agent_id);
|
GridCoord1D coord = get_location_by_agent(agent_id);
|
||||||
|
|
||||||
return delete_agent(agent_id, coord);
|
return delete_agent(agent_id, coord);
|
||||||
@@ -137,9 +137,9 @@ namespace kami {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] bool Grid1D::get_wrap_x() const { return _wrap_x; }
|
bool Grid1D::get_wrap_x() const { return _wrap_x; }
|
||||||
|
|
||||||
[[maybe_unused]] unsigned int Grid1D::get_maximum_x() const { return _maximum_x; }
|
unsigned int Grid1D::get_maximum_x() const { return _maximum_x; }
|
||||||
|
|
||||||
GridCoord1D Grid1D::get_location_by_agent(AgentID agent_id) const {
|
GridCoord1D Grid1D::get_location_by_agent(AgentID agent_id) const {
|
||||||
return _agent_index->at(agent_id);
|
return _agent_index->at(agent_id);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace kami {
|
|||||||
delete[] _agent_grid;
|
delete[] _agent_grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] bool Grid2D::delete_agent(AgentID agent_id) {
|
bool Grid2D::delete_agent(AgentID agent_id) {
|
||||||
auto coord = get_location_by_agent(agent_id);
|
auto coord = get_location_by_agent(agent_id);
|
||||||
|
|
||||||
return delete_agent(agent_id, coord);
|
return delete_agent(agent_id, coord);
|
||||||
@@ -121,8 +121,8 @@ namespace kami {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] bool Grid2D::get_wrap_x() const { return _wrap_x; }
|
bool Grid2D::get_wrap_x() const { return _wrap_x; }
|
||||||
[[maybe_unused]] bool Grid2D::get_wrap_y() const { return _wrap_y; }
|
bool Grid2D::get_wrap_y() const { return _wrap_y; }
|
||||||
|
|
||||||
std::vector<GridCoord2D> Grid2D::get_neighborhood(
|
std::vector<GridCoord2D> Grid2D::get_neighborhood(
|
||||||
AgentID agent_id, GridNeighborhoodType neighborhood_type,
|
AgentID agent_id, GridNeighborhoodType neighborhood_type,
|
||||||
@@ -196,8 +196,8 @@ namespace kami {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] unsigned int Grid2D::get_maximum_x() const { return _maximum_x; }
|
unsigned int Grid2D::get_maximum_x() const { return _maximum_x; }
|
||||||
[[maybe_unused]] unsigned int Grid2D::get_maximum_y() const { return _maximum_y; }
|
unsigned int Grid2D::get_maximum_y() const { return _maximum_y; }
|
||||||
|
|
||||||
GridCoord2D Grid2D::coord_wrap(const GridCoord2D& coord) const {
|
GridCoord2D Grid2D::coord_wrap(const GridCoord2D& coord) const {
|
||||||
auto x = coord.get_x_location();
|
auto x = coord.get_x_location();
|
||||||
|
|||||||
@@ -31,27 +31,27 @@
|
|||||||
|
|
||||||
namespace kami {
|
namespace kami {
|
||||||
|
|
||||||
[[maybe_unused]] [[maybe_unused]] std::shared_ptr<Domain> Model::get_domain() {
|
std::shared_ptr<Domain> Model::get_domain() {
|
||||||
return(_domain);
|
return(_domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] void Model::set_domain(std::shared_ptr<Domain> domain) {
|
void Model::set_domain(std::shared_ptr<Domain> domain) {
|
||||||
_domain = std::move(domain);
|
_domain = std::move(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] std::shared_ptr<Population> Model::get_population() {
|
std::shared_ptr<Population> Model::get_population() {
|
||||||
return(_pop);
|
return(_pop);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] void Model::set_population(std::shared_ptr<Population> population) {
|
void Model::set_population(std::shared_ptr<Population> population) {
|
||||||
_pop = std::move(population);
|
_pop = std::move(population);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] [[maybe_unused]] std::shared_ptr<Scheduler> Model::get_scheduler() {
|
std::shared_ptr<Scheduler> Model::get_scheduler() {
|
||||||
return(_sched);
|
return(_sched);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] void Model::set_scheduler(std::shared_ptr<Scheduler> scheduler) {
|
void Model::set_scheduler(std::shared_ptr<Scheduler> scheduler) {
|
||||||
_sched = std::move(scheduler);
|
_sched = std::move(scheduler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,6 @@ namespace kami {
|
|||||||
this->_rng = std::move(rng);
|
this->_rng = std::move(rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[maybe_unused]] std::shared_ptr<std::ranlux24> RandomScheduler::get_rng() { return (this->_rng); }
|
std::shared_ptr<std::ranlux24> RandomScheduler::get_rng() { return (this->_rng); }
|
||||||
|
|
||||||
} // namespace kami
|
} // namespace kami
|
||||||
|
|||||||
Reference in New Issue
Block a user