|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttom.library.sl.Environment
public final class Environment
Object that represents an environment of a strategy the position where the strategy is applied a pointer to subterm the root is stored in the first cell
Field Summary | |
---|---|
protected int |
current
|
static int |
FAILURE
|
static int |
IDENTITY
|
protected int[] |
omega
|
protected int |
status
|
protected Visitable[] |
subterm
|
static int |
SUCCESS
|
Constructor Summary | |
---|---|
Environment()
|
Method Summary | |
---|---|
java.lang.Object |
clone()
|
int |
depth()
Get the depth of the position in the tree |
void |
down(int n)
add a sub-position n |
boolean |
equals(java.lang.Object o)
Tests if two environments are equals |
void |
followPath(Path path)
|
void |
followPathLocal(Path path)
|
Position |
getPosition()
get the current position |
Visitable |
getRoot()
get the current root |
int |
getStatus()
|
Visitable |
getSubject()
get the term that corresponds to the current position |
int |
hashCode()
|
void |
setRoot(Visitable root)
set the current root |
void |
setStatus(int s)
|
void |
setSubject(Visitable root)
set the current term |
java.lang.String |
toString()
Returns a String object representing the position. |
void |
up()
remove the last sub-position Up and down are made public to allow to write compiled strategies by hand This may be a BAD idea |
void |
upLocal()
package private remove the last sub-position but does not update the subject |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SUCCESS
public static final int FAILURE
public static final int IDENTITY
protected int current
protected int[] omega
protected Visitable[] subterm
protected int status
Constructor Detail |
---|
public Environment()
Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getStatus()
public void setStatus(int s)
public Visitable getRoot()
public void setRoot(Visitable root)
public Visitable getSubject()
public void setSubject(Visitable root)
public Position getPosition()
public int depth()
public void up()
public void upLocal()
public void down(int n)
n
- sub-position number. 1 is the first possible sub-positionpublic void followPath(Path path)
public void followPathLocal(Path path)
public java.lang.String toString()
String
object representing the position.
The string representation consists of a list of elementary positions
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |