|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hu.birot.OTKit.performance.Temperature
public class Temperature
This class, actually a data type, represents "temperature", as it is used in simulated annealing. It can take several type: at the moment, it is either a real value or a pair as defined for SA-OT.
Field Summary | |
---|---|
int |
counter
This additional component of the temperature can be used to count the number of iterations. |
int |
counter1
An additional counter that can be used to store information. |
int |
counter2
An additional counter that can be used to store information. |
int |
iterations
This field can be used to count the number of iterations that has been performed in total since the beginning of the random walk. |
Candidate |
output
This field can be used to include information of type Candidate in the temperature. |
double |
range
The first component of the temperature in SA-OT. |
double |
real
The "real value" of temperature. |
static java.lang.String |
RealTemperatureType
This string is the value of Temperature.type for temperatures of type "real" (used in traditional simulated annealing with a real-valued target function). |
static java.lang.String |
SAOTTemperatureType
This string is the value of Temperature.type for temperatures of type "saot" (used in SA-OT). |
java.lang.String |
type
This variable tells the type of temperature. |
int |
unmoved
An additional counter that can be used to store information. |
Constructor Summary | |
---|---|
Temperature(double r)
This constructor creates a new Temperature of type "real", with real value r. |
|
Temperature(double k,
double r)
This constructor creates a new Temperature of type "saot", whose first component (range) is k, and whose second component is r. |
Method Summary | |
---|---|
Temperature |
clone()
This method creates a clone of the present temperature, with all their fields being equal. |
void |
copy(Temperature t)
This method fills all the nine fields of a temperature (counter, counter1, counter2, iterations, output, range, real, type and unmoved) with the corresponding fields of temperature t. |
boolean |
equals(java.lang.Object t)
This temperature is equal to object t if and only if: (1) t is also a temperature; (2) the two temperatures are of the same type; and (3) their value(s) are equal. |
java.lang.String |
toString()
Convert a Temperature to a String. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String type
This variable tells the type of temperature. Its values can be:
public static java.lang.String RealTemperatureType
public static java.lang.String SAOTTemperatureType
public double real
public double range
public int counter
public int counter1
counter
public int counter2
counter
public int unmoved
counter
public int iterations
public Candidate output
In fact, this field is used as a trick so that random walks can return an output candidate, but also further information (number of iterations performed, final temperature, etc.). Therefore, random walks return an output of type Temperature, and not of type Candidate as they should, and so the field output of the returned temperature will contain the candidate actually returned as the output.
Constructor Detail |
---|
public Temperature(double r)
r
- : The (real) value of the temperature.public Temperature(double k, double r)
k
- : The first component of the SA-OT-style
temperature to be created ("range").r
- : The second component of the SA-OT-style
temperature to be created ("real part").Method Detail |
---|
public void copy(Temperature t)
This method fills all the nine fields of a temperature (counter, counter1, counter2, iterations, output, range, real, type and unmoved) with the corresponding fields of temperature t.
t
- : The temperature whose fields are copied.public boolean equals(java.lang.Object t)
This temperature is equal to object t if and only if: (1) t is also a temperature; (2) the two temperatures are of the same type; and (3) their value(s) are equal. For temperatures of type "real", field real must be equal. For temperatures of type "saot", both fields real and range must be equal.
Note that the other fields (e.g. the counters, output, unmoved, iterations) of the two temperatures need not be equal in order to have equal temperatures.
Overrides java.lang.Object.equals.
equals
in class java.lang.Object
public java.lang.String toString()
Convert a Temperature to a String. Temperatures of type "saot" are converted in the form <range,real>, whereas Temperatures of type "real" are converted simply as (the decimal representation of) their real value.
This method overrides java.lang.Object.toString.
toString
in class java.lang.Object
public Temperature clone()
This method creates a clone of the present temperature, with all their fields being equal.
This method overrides method java.lang.Object.clone. Note that in this new method the return type is Temperature, and not Object, as in the original one.
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |