La simu multi-agents qui repeint une image, mais en c++ Boilerplate pompé ici : https://github.com/andrew-r-king/sfml-vscode-boilerplate
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Agent.hpp 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef AGENT_H
  2. #define AGENT_H
  3. #include <Agents/Perception/Perception.hpp>
  4. #include <Environment/PictureEnvironment.hpp>
  5. class Agent
  6. {
  7. public:
  8. Perception fCurrentPerception;
  9. PictureEnvironment* fEnvironment;
  10. sf::Color fColor;
  11. int fDotSize;
  12. int fMoveSize;
  13. int fXPos;
  14. int fYPos;
  15. Agent();
  16. Agent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize);
  17. virtual void loop();
  18. virtual void move();
  19. virtual void paint();
  20. };
  21. class RepaintAgent : public Agent
  22. {
  23. public:
  24. //list of possible movement vectors, to be used to perceive the environment
  25. std::vector<std::vector<int>> fMovements;
  26. std::vector<int> fValidMovementIndexes;
  27. std::vector<int> fCurrentMovement;
  28. RepaintAgent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize);
  29. virtual void loop();
  30. virtual void move();
  31. virtual void paint();
  32. };
  33. class PullPaintAgent : public RepaintAgent
  34. {
  35. public:
  36. PullPaintAgent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize);
  37. virtual void loop();
  38. virtual void move();
  39. };
  40. #endif // AGENT_H