|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--physis.core.task.TaskAdapter
Provides counting and merit-multiplier handling.Subclasses should override the checkActivity, getInputSize and getOutputSize and possibly the getName method and when clearing is not wanted the shouldBeCleared method.
| Field Summary | |
protected int |
counter
|
protected int |
id
|
protected double[] |
meritmultipliers
|
| Constructor Summary | |
TaskAdapter()
|
|
| Method Summary | |
void |
changeBonuses(double multiplier)
Multiplies the bonuses via multiplying the bonus's part above 1.0. |
boolean |
checkActivity(int[] in,
int[] out)
Checks an IO activity whether it performs the represented task. |
int |
getCounter()
Gets the value of task counter. |
int |
getID()
Returns the internal ID of the task. |
int |
getInputSize()
Returns the number of input arguments. |
double |
getMeritMultiplier(int nth)
Returns the merit multiplier when the task is performed. |
java.lang.String |
getName()
The name equals the class name without the physis.core.task. |
int |
getNumberOfRewardedPerforms()
Not all executions of a task are rewarded. |
int |
getOutputSize()
Returns the number of generated values. |
void |
increaseCounter()
If the task is performed, the counter should be increased. |
void |
setID(int id_)
Sets the internal ID |
void |
setMeritMultipliers(double[] meritms)
Sets the meritmultipliers. |
boolean |
shouldBeCleared()
Clearing is the default. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected int counter
protected double[] meritmultipliers
protected int id
| Constructor Detail |
public TaskAdapter()
| Method Detail |
public void setMeritMultipliers(double[] meritms)
TasksetMeritMultipliers in interface Taskpublic double getMeritMultiplier(int nth)
TaskgetMeritMultiplier in interface Taskphysis.core.task.Tasknth - The number indicating how many times the task was performed.
public boolean checkActivity(int[] in,
int[] out)
TaskcheckActivity in interface Taskpublic int getInputSize()
TaskgetInputSize in interface Taskpublic int getOutputSize()
TaskgetOutputSize in interface Taskpublic int getNumberOfRewardedPerforms()
TaskgetNumberOfRewardedPerforms in interface Taskpublic void changeBonuses(double multiplier)
TaskchangeBonuses in interface Taskpublic boolean shouldBeCleared()
shouldBeCleared in interface Taskpublic void increaseCounter()
TaskincreaseCounter in interface Taskpublic int getCounter()
TaskgetCounter in interface Taskpublic java.lang.String getName()
getName in interface Taskpublic int getID()
TaskgetID in interface Taskpublic void setID(int id_)
TasksetID in interface Taskpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||