rand.asset_forfeiture
Interface ProfitCalculator

All Known Implementing Classes:
Benchmark, GCalc, KFixed, KVariable

public interface ProfitCalculator

An interface that lays out the requirements for a class to calculate the profits derived from hiring illegal immigrants.


Method Summary
 void calculateBase(javax.swing.JTextArea forDebuggers)
          Does the calculations for the world as described, determining the values of any parameters needed for the excursion to a legals-only framework.
 void calculateExcursion(javax.swing.JTextArea forDebuggers)
          Does the calculations for the world without illegal immigrants, including what the profits of the firm would be, how many workers of each type would be hired, etc.
 java.lang.String getName()
          The name of this particular ProfitCalculator.
 java.util.HashMap<variables,java.lang.Double> getOptimal()
          While calculateExcursion does the calculations, this method returns the results, so you don't have to do both simultaneously.
 java.lang.Boolean needsVar(variables v)
          Determines whether this implementation of ProfitCalculator requires a particular variable for its calculations.
 void setNewPL3(double p)
          A method for updating the value for PL3 used in calculateExcursion based on some more detailed knowledge that the user has of the case in question.
 java.lang.Boolean setVals(java.util.HashMap<variables,java.lang.Double> vals)
          This method will provide the inputs to the calculation in the form of a HashMap mapping an available variable to its value.
 java.lang.Boolean validate()
          This method runs any input validation available for the ProfitCalculator.
 

Method Detail

setVals

java.lang.Boolean setVals(java.util.HashMap<variables,java.lang.Double> vals)
This method will provide the inputs to the calculation in the form of a HashMap mapping an available variable to its value. In general, variables not specified are missing, not assumed to be zero. This is to allow flexibility in allowing some calculations to use only a subset of the available variables. \param vals the HashMap containing the variable-value mappings \returns true if the inputs are valid for this particular calculator


validate

java.lang.Boolean validate()
This method runs any input validation available for the ProfitCalculator. This method should check things such as all the required variables being present, values being within predetermined ranges (e.g. wages >= 0), etc. \returns true if the ProfitCalculator is in a valid state, false otherwise.


calculateBase

void calculateBase(javax.swing.JTextArea forDebuggers)
Does the calculations for the world as described, determining the values of any parameters needed for the excursion to a legals-only framework. \param forDebuggers append any relevant debugging output to this JTextArea for user-level debugging and understanding.


calculateExcursion

void calculateExcursion(javax.swing.JTextArea forDebuggers)
Does the calculations for the world without illegal immigrants, including what the profits of the firm would be, how many workers of each type would be hired, etc. \param forDebuggers append any relevant debugging output to this JTextArea for user-level debugging and understanding.


getName

java.lang.String getName()
The name of this particular ProfitCalculator. \returns a string with the name of the calculator. Does not have to be unique.


needsVar

java.lang.Boolean needsVar(variables v)
Determines whether this implementation of ProfitCalculator requires a particular variable for its calculations. \param v the variable in question \returns true if the variable is required; false if it is not


setNewPL3

void setNewPL3(double p)
A method for updating the value for PL3 used in calculateExcursion based on some more detailed knowledge that the user has of the case in question. \param p the new value of PL3


getOptimal

java.util.HashMap<variables,java.lang.Double> getOptimal()
While calculateExcursion does the calculations, this method returns the results, so you don't have to do both simultaneously. \returns a HashMap with the optimal values of the relevant variables