diff --git a/Library/PAX_SAPIENTICA/Simulation/ConvertToMercatorCoordinate.hpp b/Library/PAX_SAPIENTICA/Simulation/ConvertToMercatorCoordinate.hpp index c67e52743..640733fa6 100644 --- a/Library/PAX_SAPIENTICA/Simulation/ConvertToMercatorCoordinate.hpp +++ b/Library/PAX_SAPIENTICA/Simulation/ConvertToMercatorCoordinate.hpp @@ -18,11 +18,12 @@ #include +#include #include namespace paxs { template - Vector2 convertToMercatorCoordinate(const Vector2& start_position, const Vector2& position, const int z, const int pixel_size) { + Vector2 convertToMercatorCoordinate(const Vector2& start_position, const Vector2& position, const int z) { const double n = std::pow(2, z); const double pixel_sum = pixel_size * n; const double u = (double)position.x / pixel_sum + start_position.x / n; diff --git a/Library/PAX_SAPIENTICA/Simulation/Data.hpp b/Library/PAX_SAPIENTICA/Simulation/Data.hpp index 97455b4fe..ee780048c 100644 --- a/Library/PAX_SAPIENTICA/Simulation/Data.hpp +++ b/Library/PAX_SAPIENTICA/Simulation/Data.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -72,8 +73,6 @@ namespace paxs { return itr->second; } private: - const int pixel_size = 256; - Vector2 start_position; Vector2 end_position; std::string name; diff --git a/Library/PAX_SAPIENTICA/Simulation/Environment.hpp b/Library/PAX_SAPIENTICA/Simulation/Environment.hpp index e36dcdfde..52bd071b4 100644 --- a/Library/PAX_SAPIENTICA/Simulation/Environment.hpp +++ b/Library/PAX_SAPIENTICA/Simulation/Environment.hpp @@ -29,6 +29,7 @@ #include #include #include +#include #include namespace paxs { @@ -37,8 +38,6 @@ namespace paxs { public: using Vector2 = paxs::Vector2; - int pixel_size = 256; - using DataVariant = std::variant, Data, Data>; std::unordered_map data_map; diff --git a/Library/PAX_SAPIENTICA/Simulation/Human.hpp b/Library/PAX_SAPIENTICA/Simulation/Human.hpp new file mode 100644 index 000000000..f33f7ff99 --- /dev/null +++ b/Library/PAX_SAPIENTICA/Simulation/Human.hpp @@ -0,0 +1,39 @@ +/*########################################################################################## + + PAX SAPIENTICA Library πŸ’€πŸŒΏπŸŒ + + [Planning] 2023 As Project + [Production] 2023 As Project + [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/PAX_SAPIENTICA + [License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ + +##########################################################################################*/ + +#ifndef PAX_SAPIENTICA_SIMULATION_HUMAN_HPP +#define PAX_SAPIENTICA_SIMULATION_HUMAN_HPP + +/*########################################################################################## + +##########################################################################################*/ + +#include + +namespace paxs { + template + class Human : public Agent { + public: + using Vector2 = paxs::Vector2; + using Environment = paxs::Environment; + + Human(const std::string& id, const std::string& name, const Vector2& pos, const std::uint_least8_t gen, const std::uint_least8_t age, const std::uint_least8_t life_exp, Environment* env) + : Agent(id, name, pos, gen, age, life_exp, env) {} + + bool operator==(const paxs::Human& a) { + return Agent::operator==(a); + } + protected: + + }; +} + +#endif // !PAX_SAPIENTICA_SIMULATION_HUMAN_HPP \ No newline at end of file diff --git a/Library/PAX_SAPIENTICA/Simulation/SimulationConst.hpp b/Library/PAX_SAPIENTICA/Simulation/SimulationConst.hpp new file mode 100644 index 000000000..387bd6a14 --- /dev/null +++ b/Library/PAX_SAPIENTICA/Simulation/SimulationConst.hpp @@ -0,0 +1,23 @@ +/*########################################################################################## + + PAX SAPIENTICA Library πŸ’€πŸŒΏπŸŒ + + [Planning] 2023 As Project + [Production] 2023 As Project + [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/PAX_SAPIENTICA + [License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ + +##########################################################################################*/ + +#ifndef PAX_SAPIENTICA_SIMULATION_SIMULATION_CONST_HPP +#define PAX_SAPIENTICA_SIMULATION_SIMULATION_CONST_HPP + +/*########################################################################################## + +##########################################################################################*/ + +namespace paxs { + static int pixel_size = 256; +} + +#endif // !PAX_SAPIENTICA_SIMULATION_SIMULATION_CONST_HPP \ No newline at end of file diff --git a/Library/PAX_SAPIENTICA/Simulation/Simulator.hpp b/Library/PAX_SAPIENTICA/Simulation/Simulator.hpp index ebad8292a..3fd37e44f 100644 --- a/Library/PAX_SAPIENTICA/Simulation/Simulator.hpp +++ b/Library/PAX_SAPIENTICA/Simulation/Simulator.hpp @@ -18,6 +18,7 @@ #include #include +#include namespace paxs { template @@ -74,8 +75,8 @@ namespace paxs { void randomizeAgents(const int agent_count) { const Vector2& offset = environment.getEndPosition() - environment.getStartPosition(); - std::uniform_int_distribution<> x_dist(0, environment.pixel_size * offset.x); - std::uniform_int_distribution<> y_dist(0, environment.pixel_size * offset.y); + std::uniform_int_distribution<> x_dist(0, pixel_size * offset.x); + std::uniform_int_distribution<> y_dist(0, pixel_size * offset.y); std::uniform_int_distribution<> age_dist(0, 20); std::cout << "Randomizing agents..." << std::endl; for(int i = 0;i < agent_count;++i) {