Grid and domain cleanup and documentation updates

This commit is contained in:
James P. Howard, II
2022-09-03 21:56:15 -04:00
parent 860e367785
commit e1028a377d
5 changed files with 32 additions and 11 deletions

View File

@@ -51,7 +51,7 @@ namespace kami {
/**
* @brief Constructor for one-dimensional coordinates
*/
explicit GridCoord1D(int x_coord);;
explicit GridCoord1D(int x_coord);
/**
* @brief Return the `x` coordinate

View File

@@ -133,10 +133,31 @@ namespace kami {
inline friend GridCoord2D operator*(const double lhs, const GridCoord2D &rhs);
protected:
/**
* @brief Find the distance between two points using the Chebyshev metric
*
* @param p the point to measure the distance to
*
* @returns the distance as a `double`
*/
inline double distance_chebyshev(std::shared_ptr<GridCoord2D> &p) const;
/**
* @brief Find the distance between two points using the Euclidean metric
*
* @param p the point to measure the distance to
*
* @returns the distance as a `double`
*/
inline double distance_euclidean(std::shared_ptr<GridCoord2D> &p) const;
/**
* @brief Find the distance between two points using the Manhattan metric
*
* @param p the point to measure the distance to
*
* @returns the distance as a `double`
*/
inline double distance_manhattan(std::shared_ptr<GridCoord2D> &p) const;
private:

View File

@@ -23,11 +23,11 @@
* SOFTWARE.
*/
#include <kami/domain.h>
#include <iostream>
#include <string>
#include <kami/domain.h>
namespace kami {
std::ostream &operator<<(std::ostream &lhs, const Coord &rhs) {

View File

@@ -23,10 +23,6 @@
* SOFTWARE.
*/
#include <kami/agent.h>
#include <kami/domain.h>
#include <kami/grid1d.h>
#include <map>
#include <memory>
#include <optional>
@@ -35,6 +31,10 @@
#include <unordered_set>
#include <utility>
#include <kami/agent.h>
#include <kami/domain.h>
#include <kami/grid1d.h>
namespace kami {
GridCoord1D::GridCoord1D(int x_coord) : _x_coord(x_coord) {}

View File

@@ -23,10 +23,6 @@
* SOFTWARE.
*/
#include <kami/agent.h>
#include <kami/domain.h>
#include <kami/grid2d.h>
#include <map>
#include <memory>
#include <optional>
@@ -34,6 +30,10 @@
#include <utility>
#include <vector>
#include <kami/agent.h>
#include <kami/domain.h>
#include <kami/grid2d.h>
namespace kami {
int GridCoord2D::get_x_location() const {