Package org.evoludo.simulator.modules
Enum Class Continuous.Costs
- All Implemented Interfaces:
Serializable
,Comparable<Continuous.Costs>
,Constable
,CLOption.Key
- Enclosing class:
Continuous
Selected cost functions to translate continuous traits into payoffs. Enum on
steroids. Currently available cost functions are:
- 0
- Linear cost function (independent of opponent): \(C(x,y)=c_0\,x\).
- 1
- Quadratic cost function (independent of opponent): \(C(x,y)=c_0\,x+c_1\,x^2\).
- 2
- Square root cost function (independent of opponent): \(C(x,y)=c_0 \sqrt{x}\).
- 3
- Logarithmic cost function (independent of opponent): \(C(x,y)=c_0 \ln(c_1\,x+1)\).
- 4
- Exponential cost function (independent of opponent): \(C(x,y)=c_0 (1-\exp(-c_1\,x))\).
- 10
- Linear cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)\).
- 11
- Quadratic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2\).
- 12
- Cubic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2+c_2 (x+y)^3\).
- 13
- Quartic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2+c_2 (x+y)^3+c_3 (x+y)^4\).
- 20
- Linear cost function (cross terms of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0\,x+c_1\,y+c_2\,x\,y\).
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExponential cost function (independent of opponent): \(C(x,y)=c_0 (1-\exp(-c_1\,x))\).Linear cost function (independent of opponent): \(C(x,y)=c_0\,x\).Logarithmic cost function (independent of opponent): \(C(x,y)=c_0 \ln(c_1\,x+1)\).Quadratic cost function (independent of opponent): \(C(x,y)=c_0\,x+c_1\,x^2\).Square root cost function (independent of opponent): \(C(x,y)=c_0 \sqrt{x}\).Linear cost function (cross terms of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0\,x+c_1\,y+c_2\,x\,y\).Linear cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)\).Quadratic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2\).Quartic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2+c_2 (x+y)^3+c_3 (x+y)^4\).Cubic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2+c_2 (x+y)^3\). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Return key of in this collection.getTitle()
Brief description of purpose of this key.toString()
static Continuous.Costs
Returns the enum constant of this class with the specified name.static Continuous.Costs[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from interface CLOption.Key
getDescription
-
Enum Constant Details
-
ME_LINEAR
Linear cost function (independent of opponent): \(C(x,y)=c_0\,x\). -
ME_QUAD
Quadratic cost function (independent of opponent): \(C(x,y)=c_0\,x+c_1\,x^2\). -
ME_SQRT
Square root cost function (independent of opponent): \(C(x,y)=c_0 \sqrt{x}\). -
ME_LOG
Logarithmic cost function (independent of opponent): \(C(x,y)=c_0 \ln(c_1\,x+1)\). -
ME_EXP
Exponential cost function (independent of opponent): \(C(x,y)=c_0 (1-\exp(-c_1\,x))\). -
WE_LINEAR
Linear cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)\). -
WE_QUAD
Quadratic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2\). -
WE_QUBIC
Cubic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2+c_2 (x+y)^3\). -
WE_QUARTIC
Quartic cost function (sum of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0 (x+y)+c_1 (x+y)^2+c_2 (x+y)^3+c_3 (x+y)^4\). -
MEYOU_LINEAR
Linear cost function (cross terms of focal, \(x\), and opponent, \(y\), traits): \(C(x,y)=c_0\,x+c_1\,y+c_2\,x\,y\).
-
-
Field Details
-
Constructor Details
-
Costs
Create a new type of cost function with keykey
and descriptiontitle
as well asnParams
parameters.- Parameters:
key
- the identifier for parsing of command line optiontitle
- the summary of the cost functionnParams
- the number of parameters
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
- Overrides:
toString
in classEnum<Continuous.Costs>
-
getKey
Description copied from interface:CLOption.Key
Return key of in this collection. Used when parsing command line options.- Specified by:
getKey
in interfaceCLOption.Key
- Returns:
- the key of the command line option
-
getTitle
Description copied from interface:CLOption.Key
Brief description of purpose of this key. Used in GUI and in help display.- Specified by:
getTitle
in interfaceCLOption.Key
- Returns:
- the title of the command line option
- See Also:
-