//==============================================================================
// The Society of Actuaries (SOA) makes this computer model and its computer
// code available to its members for educational purposes. The model and its
// code may be modified and redistributed without prior authorization from the
// SOA. The SOA distributes this computer model and its computer code in the
// hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE.
//============================================================================== 

package agents;

import resources.AgentID;
import resources.Constants.GoalDescription;

//==============================================================================
//Import statements
//------------------------------------------------------------------------------

public abstract class Agent
{
//==============================================================================
// Attribute variables
// These variables describe the agent at a point in time.
// They are available to other classes through "getter" methods. 
//------------------------------------------------------------------------------
    private AgentID agentID;
    private String agentName;
    private double agentXLocation;
    private double agentYLocation;
    private GoalDescription agentFirstPriorityGoalDescription;
    private GoalDescription agentSecondPriorityGoalDescription;
    private GoalDescription agentLastPriorityGoalDescription;
//==============================================================================


//==============================================================================
// Memory variables
// These variables include information that changes over time.
// They represent the agent's memory.
//------------------------------------------------------------------------------

// None

//==============================================================================

//==============================================================================
// Other variables
// These are other variables used in the class. 
//------------------------------------------------------------------------------

// None

//==============================================================================


//==============================================================================
// Methods: Initialization methods for the agent. These are used in
//          the agent's constructor method or at the beginning of each
//          simulation period.
//==============================================================================

// None

//==============================================================================


//==============================================================================
// Methods:  "Input" methods for the agent. These are described in the
// detailed description of the model. Each method is preceded by "i#".
//==============================================================================

// None

//==============================================================================


//==============================================================================
// Methods:  "Process" methods for the agent. These are described in the
// detailed description of the model. Each method is preceded by "p#"
// to indicate its number according to the numbering scheme used in the
// detailed description.
//==============================================================================

// None

//==============================================================================


//==============================================================================
// Methods:  "Rule" methods for the agent. These are described in the
// detailed description of the model. Each method is preceded by "r#"
// to indicate its number according to the numbering scheme used in the
// detailed description.
//==============================================================================

// None

//==============================================================================


//==============================================================================
// Methods:  General methods for the agent.
//==============================================================================

//==============================================================================
// Method:  distance()
// Calculates the distance between two points.
// It is used in subclasses, and so has "protected" scope.
//------------------------------------------------------------------------------
    protected double distance(double pLocation1X, double pLocation1Y,
            double pLocation2X, double pLocation2Y)
    {
        double distance;
        
        distance = Math.pow(Math.pow(pLocation1X - pLocation2X, 2)
                + Math.pow(pLocation1Y - pLocation2Y, 2), 0.5);
        
        return distance;
        
    }//end distance()
//==============================================================================


//==============================================================================
// Methods: "Probe" methods for the model user to probe the agent's data.
// Note:    As a simulation runs, the model user can probe an agent by
//          double-clicking on its icon in the display. For more information
//          about probes, see the Repast Simphony reference documentation.
//==============================================================================

// None

//==============================================================================


//==============================================================================
// Methods:  "Analysis" methods to support simulation charts and graphs.
//==============================================================================

// None

//==============================================================================


//==============================================================================
// Methods:  getter and setter methods
//------------------------------------------------------------------------------
 
    public AgentID getAgentID()
    {
        return (agentID);
    }

    public void setAgentID(AgentID pAgentID)
    {
        agentID = pAgentID;
    }

    public double getAgentXLocation()
    {
        return (agentXLocation);
    }

    public double getAgentYLocation()
    {
        return (agentYLocation);
    }

    public void setAgentXLocation(double pXLocation)
    {
        agentXLocation = pXLocation;
    }
    
    public void setAgentYLocation(double pYLocation)
    {
        agentYLocation = pYLocation;
    }
    
    public GoalDescription getAgentFirstPriorityGoalDescription()
    {
        return agentFirstPriorityGoalDescription;
    }

    public void setAgentFirstPriorityGoalDescription(GoalDescription agentFirstPriorityGoalDescription)
    {
        this.agentFirstPriorityGoalDescription = agentFirstPriorityGoalDescription;
    }   

    public GoalDescription getAgentSecondPriorityGoalDescription()
    {
        return agentSecondPriorityGoalDescription;
    }

    public void setAgentSecondPriorityGoalDescription(GoalDescription agentSecondPriorityGoalDescription)
    {
        this.agentSecondPriorityGoalDescription = agentSecondPriorityGoalDescription;
    }

    public GoalDescription getAgentLastPriorityGoalDescription()
    {
        return agentLastPriorityGoalDescription;
    }

    public void setAgentLastPriorityGoalDescription(GoalDescription agentLastPriorityGoalDescription)
    {
        this.agentLastPriorityGoalDescription = agentLastPriorityGoalDescription;
    }

    public String getAgentName()
    {
        return agentName;
    }

    public void setAgentName(String agentName)
    {
        this.agentName = agentName;
    }

//==============================================================================


}//end Agent class

