-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtom.h
More file actions
39 lines (27 loc) · 1.18 KB
/
Atom.h
File metadata and controls
39 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <iostream>
#include <array>
using namespace std;
class Atom{
public:
Atom(array<int,2> const (&position), bool isStk=false ) // Constructor
:r(position), isSticking(isStk) ,isMoving(true) // isTouching(false), // For cluster individual size analysis
{}
array<int,2> get_r()const;
bool isMovingStatus()const; // Getters don't modify the object -> const functions
//bool isTouchingStatus();
void move(array<double,6> const (&probaMove),array<array<int,2>,6> const (&indexNeighbours), double randomNumber); //return new position
bool getSticking() const{ // const because don't change the object
if(isSticking==true){return true;}
else if (isSticking==false){return false;}
else{cout<<"ERROR GET STICKING at X:"<<get_r()[0]<<" Y: "<<get_r()[1]<<endl;
return false;}
}
void setSticking(bool valueStick){isSticking=valueStick;}
private:
array<int,2> r; // Coordinates are integers, need an array of 2 int
bool isSticking;
bool isMoving;
//bool isTouching; // Could be useful to separate the cluster for individual size analysis, not done at the moment
//array<double,6>probaMvmt;
};