public class State<T extends Payload<U>,U> extends Object implements Comparable<State<T,U>>, org.apache.hadoop.io.Writable
Mapping
Constructor and Description |
---|
State() |
State(double[] x0,
double omni)
Invent a new state with no momentum (yet).
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(State<T,U> other)
Natural order is to sort in descending order of score.
|
State<T,U> |
copy()
Deep copies a state, useful in mutation.
|
boolean |
equals(Object o) |
double |
get(int i)
Returns a transformed parameter.
|
int |
getId() |
double[] |
getMappedParams()
Returns all the parameters in mapped form.
|
Mapping[] |
getMaps() |
double |
getOmni() |
double[] |
getParams() |
T |
getPayload() |
double[] |
getStep() |
double |
getValue() |
int |
hashCode() |
State<T,U> |
mutate()
Clones this state with a random change in position.
|
void |
readFields(DataInput input) |
void |
setId(int id) |
void |
setMap(int i,
Mapping m)
Defines the transformation for a parameter.
|
void |
setMaps(Iterable<Mapping> maps) |
void |
setMaps(Mapping[] maps) |
void |
setOmni(double omni) |
void |
setPayload(T payload) |
void |
setStep(double[] step) |
void |
setValue(double v) |
String |
toString() |
void |
write(DataOutput out) |
public State()
public State(double[] x0, double omni)
public State<T,U> mutate()
public void setMap(int i, Mapping m)
i
- Which parameter's mapping to define.m
- The mapping to use.Mapping
public double get(int i)
i
- The parameter to return.public int getId()
public double[] getParams()
public Mapping[] getMaps()
public double[] getMappedParams()
public double getOmni()
public double[] getStep()
public T getPayload()
public double getValue()
public void setOmni(double omni)
public void setId(int id)
public void setStep(double[] step)
public void setMaps(Mapping[] maps)
public void setValue(double v)
public void setPayload(T payload)
public int compareTo(State<T,U> other)
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput input) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.