#ifndef MACHINE_H
#define MACHINE_H
#include "Product.h"
#include <string>
#include <iostream>
#include <cmath>
using namespace std;

class Machine{
	private:
		string name;
		int complexity;
	public:
		Machine(string startName, int startComplexity);
		void process(Product& p);
};

Machine::Machine(string startName, int startComplexity){
	name=startName;
	complexity=startComplexity;
}

void Machine::process(Product& p){
	//cout<<name<<" is processing Product "<<p.getId()<<"..."<<endl;

	long long iterations=complexity*1000000LL;
	double dummyValue=0.0;
	for(long long i=0; i<iterations; i++){
		dummyValue+=sin(i);
	}
	p.setState(name+" Completed");
	p.setValue(dummyValue);
}

#endif
