/*
 * Signal.java
 *
 * Created on 25 of June 2007, 17:14
 */

/**
 *
 * @author Paulo Roque Silva
 */
import java.io.*;

public class Signal implements Serializable {
    public static final long    serialVersionUID = 2015L; // Data version
    int 		 				emitter; // The identification of the node that emitted the signal
    boolean 					active;  // If the signal is or isn't present
    int							pleasure; // Positive if pleasure, negative if displeasure
    float						recPower, // Original recorded power
    							actPower; // Actual or real power
    
    /** Creates a new instance of Signal */
    public Signal(int em, float pwr, int plsr) {
        
        emitter  = em;
        active   = false;
        pleasure = plsr; // Quality input
        recPower = pwr; // Never changes except in act nodes with surviver adaption
        actPower = pwr; // To be reset to a new value
    }
    
    public void setActive(boolean ac) {
        
        active = ac;
    }

    public void setRecPower(float pw) {
        
        recPower = pw;
    }

    public void setActPower(float pw) {
        
        actPower = pw;
    }

    public void addActPower(float pw) {
        
        actPower += pw;
    }

    public void setPleasure(int pl) {
        
        pleasure = pl;
    }
}