1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #ifndef AGENT_H
- #define AGENT_H
- #include <Agents/Perception/Perception.hpp>
-
- #include <Environment/PictureEnvironment.hpp>
-
- class Agent
- {
- public:
- Perception fCurrentPerception;
-
- PictureEnvironment* fEnvironment;
- sf::Color fColor;
- int fDotSize;
- int fMoveSize;
- int fXPos;
- int fYPos;
- int fEnvWidth;
- int fEnvHeight;
- Agent();
- Agent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize);
- virtual void loop();
-
- virtual void move();
- virtual void paint();
- };
-
- class RepaintAgent : public Agent
- {
- public:
- //list of possible movement vectors, to be used to perceive the environment
- std::vector<std::vector<int>> fMovements;
- std::vector<int> fValidMovementIndexes;
- std::vector<int> fCurrentMovement;
- int fTolerance;
-
- RepaintAgent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize, int iTolerance);
- virtual void loop();
- virtual void move();
- virtual void paint();
-
- bool colorCloseEnough(sf::Uint32 iColor);
-
- protected:
- virtual void init();
- };
-
- class StraightPaintAgent : public RepaintAgent
- {
- public:
- StraightPaintAgent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize, int iTolerance);
-
- protected:
- virtual void init();
- };
-
- class PullPaintAgent : public RepaintAgent
- {
- public:
- PullPaintAgent(PictureEnvironment* iEnvironment, int iDotSize, int iMoveSize);
- virtual void loop();
- virtual void move();
- };
-
- #endif // AGENT_H
|