| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
-
- namespace MultiAgentSystemPCL
- {
- public class Waste : ObjectInWorld
- {
- private const double PROBA_DECREASE = 0.6;
- protected int type;
- public int Type
- {
- get { return type; }
- }
- protected int size = 1;
- public int Size
- {
- get { return size; }
- }
- public int Zone
- {
- get { return 10 + (8 * size - 1); }
- }
- public Waste(double _posX, double _posY, int _type)
- {
- PosX = _posX;
- PosY = _posY;
- type = _type;
- }
- public Waste(Waste _goal)
- {
- PosX = _goal.PosX;
- PosY = _goal.PosY;
- type = _goal.type;
- }
- internal void Decrease()
- {
- size--;
- }
- internal void Increase()
- {
- size++;
- }
- internal double ProbaToTake()
- {
- double proba = 1.0;
- for (int i = 1; i < size; i++)
- {
- proba *= PROBA_DECREASE;
- }
- return proba;
- }
- }
- }
|