package Model;

import java.io.Serializable;

public class Machine implements Serializable
{

	private static final long serialVersionUID = 7997758653124968814L;
	
	private String nom;
	private double production;
	private String identifiant;
	
	public Machine(String nom,double production) 
	{
		this.nom = nom;
		this.production = production;
		id();
	}
	
	private void id()
	{
		String fin = "";
		fin += (nom.substring(0,2) + Integer.toString((int)(1000*Math.random())));
		this.identifiant = fin;
	}
	
	public String toString()
	{
		return ("Cette machine est : " + this.nom + " a pour une production de : " + this.production + " produit/heure et a pour identifiant: " + this.identifiant);
	}

	public String getNom() 
	{
		return nom;
	}

	public void setNom(String nom) 
	{
		this.nom = nom;
	}

	public double getProduction() 
	{
		return production;
	}

	public void setProduction(double production) 
	{
		this.production = production;
	}

	public String getIdentifiant() 
	{
		return identifiant;
	}

	public void setIdentifiant(String identifiant) 
	{
		this.identifiant = identifiant;
	}

}
