|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectzeus.concepts.Fact
The Fact class is key conceptual data structure in ZEUS, since Fact objects
store the information that collectively forms the application ontology.
Each fact consists of a number of attribute-value pairs, which are stored
in the AttributeList variable.
Fact objects come in two forms:
Facts originate from template descriptions, so they can only be created
from an existing ontology by invoking the OntologyDb.getFact(boolean, java.lang.String)
method of the agent's OntologyDb.
This class is a little case study in how a little knowledge can be a dangerous
thing. It seems that the concept of checking boolean flags one at a time didn't
appeal to whoever implemented it (DN?) and instead a int based mask system
has been used to check and set the characteristics of the class. Unfortunately
I suspect that the mask is used in side effects for a number of algorithms
in the core reasoners, so while I would like to remove this nonsense, I so far
haven't summed up the courage!
| Field Summary | |
static char |
A_CHR
|
static java.lang.String |
A_STR
|
protected AttributeList |
attr
|
(package private) java.lang.String |
descp
|
static char |
F_CHR
|
static java.lang.String |
F_STR
|
static boolean |
FACT
|
(package private) ValueFunction |
functor
|
protected java.lang.String |
id
|
protected static int |
IS_LOCAL
|
protected static int |
IS_NEGATION
|
protected static int |
IS_READ_ONLY
|
protected static int |
IS_REPLACED
|
protected static int |
IS_SIDE_EFFECT
|
protected static int |
IS_VARIABLE
|
protected int |
modifiers
|
static java.lang.String |
NONVAR
|
protected OntologyDb |
ontology
|
static java.lang.String |
SELF
|
static java.lang.String |
SELF_NAME
|
static java.lang.String |
THIS
|
static java.lang.String |
THIS_NAME
|
protected java.lang.String |
type
|
static char |
V_CHR
|
static java.lang.String |
V_STR
|
static java.lang.String |
VAR
|
static boolean |
VARIABLE
|
| Constructor Summary | |
|
Fact()
|
|
Fact(boolean is_variable,
Fact fact)
|
(package private) |
Fact(boolean is_variable,
java.lang.String type,
OntologyDb ontology,
GenSym genSym)
|
|
Fact(Fact fact)
|
protected |
Fact(java.lang.String type,
java.lang.String id,
int modifiers,
AttributeList attr,
OntologyDb ontology)
|
| Method Summary | |
java.lang.String[] |
buildMap(Fact mapper)
test to see if any of the values in this fact are mapped to the valeus in the @param mapper, make a map of attno to attno for all the attributes so that they can be mapped in the method map |
TreeNode |
createAttributeTree(boolean mode)
Here mode defines whether or not this fact owns the attribute being edited, where 'true' implies the fact owns the attribute |
private void |
debug(java.lang.String str)
|
boolean |
disjoin(Fact f)
|
void |
doMap(Fact mapper,
java.lang.String[] tmap)
map the values of the attributes in this fact to the values in the fact mapper. map is an array of ints such that map[1] = 3 indicates that the attribute value[3] of mapper should be mapped to the value 1 of this fact |
Fact |
duplicate(DuplicationTable table)
|
Fact |
duplicate(java.lang.String name,
GenSym genSym)
|
boolean |
equals(java.lang.Object obj)
possibly this should return a true if it is equals in an oo sense? |
ValueFunction |
functor()
|
AttributeList |
getAttributeList()
getAttributeList returns a list of the attributes of the Fact. |
double |
getDouble(java.lang.String attribute)
|
ValueFunction |
getFn(java.lang.String attribute)
|
java.lang.String |
getId()
|
int |
getInt(java.lang.String attribute)
|
long |
getLong(java.lang.String attribute)
|
int |
getModifiers()
|
double |
getNetCost()
|
int |
getNumber()
|
OntologyDb |
getOntologyDb()
made this accessor public (simon 23/9/02) with the object of using it to get service description information |
java.lang.String |
getType()
|
double |
getUnitCost()
|
ValueFunction |
getVal(int pos)
|
java.lang.String |
getValue(java.lang.String attribute)
|
java.lang.String |
ID()
|
boolean |
isa(java.lang.String ancestor)
|
boolean |
isDeterminate()
|
boolean |
isDeterminate(java.lang.String attribute)
|
boolean |
isLocal()
|
static boolean |
isLocal(int x)
|
boolean |
isNegative()
|
static boolean |
isNegative(int x)
|
boolean |
isReadOnly()
|
static boolean |
isReadOnly(int x)
|
boolean |
isReplaced()
|
static boolean |
isReplaced(int x)
|
boolean |
isSideEffect()
|
static boolean |
isSideEffect(int x)
|
boolean |
isVariable()
|
static boolean |
isVariable(int x)
|
java.lang.String[] |
listAttributes()
|
ValueFunction[] |
listValues()
|
static void |
main(java.lang.String[] argv)
|
void |
map(Fact toMap)
|
protected static java.lang.String |
name(boolean isVariable,
GenSym genSym)
|
VarFn |
newVar()
|
static java.lang.String |
newVar(GenSym genSym)
|
java.lang.String[] |
objectAttributeNames()
|
java.lang.String |
pprint()
|
java.lang.String |
pprint(int sp)
|
java.lang.String |
printDAML(java.lang.String header,
java.lang.String footer)
this is a bit of a mess, because we are passing a parameter that is used to ppring the fact into DAML format... header is the front of the parameter, footer is the close tag |
boolean |
resolve(Bindings bindings)
|
boolean |
resolve(ResolutionContext context,
Bindings bindings)
|
(package private) void |
setAttributeList(AttributeList List)
|
protected void |
setFunctor()
|
void |
setId(java.lang.String id)
|
void |
setIsLocal(boolean set)
|
static int |
setIsLocal(int x,
boolean set)
|
void |
setIsNegative(boolean set)
|
static int |
setIsNegative(int x,
boolean set)
|
void |
setIsReadOnly(boolean set)
|
static int |
setIsReadOnly(int x,
boolean set)
|
void |
setIsReplaced(boolean set)
|
static int |
setIsReplaced(int x,
boolean set)
|
void |
setIsSideEffect(boolean set)
|
static int |
setIsSideEffect(int x,
boolean set)
|
void |
setIsVariable(boolean set)
|
static int |
setIsVariable(int x,
boolean set)
|
void |
setModifiers(int modifiers)
|
void |
setNumber(int x)
|
void |
setNumber(VarFn var1)
|
void |
setType(java.lang.String type)
|
void |
setUnitCost(double x)
|
void |
setUnitCost(VarFn var1)
|
void |
setValue(java.lang.String attribute,
boolean value)
|
void |
setValue(java.lang.String attribute,
double value)
|
void |
setValue(java.lang.String attribute,
int value)
|
void |
setValue(java.lang.String attribute,
long value)
|
void |
setValue(java.lang.String attribute,
java.lang.String value)
|
void |
setValue(java.lang.String attribute,
ValueFunction value)
|
void |
setValues(java.lang.String[] input)
|
java.lang.String |
toSL()
added by Simon on 20/02/02 Get the SL value of this fact An abs factory implementation would be better, but I want to have a go at this first before investing too heavily in a final implementation |
java.lang.String |
toString()
|
boolean |
unifiesWith(Fact f,
Bindings bindings)
|
boolean |
unifiesWithChild(Fact f,
Bindings bindings)
|
ValueFunction[] |
variables()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String NONVAR
public static final java.lang.String VAR
public static final java.lang.String V_STR
public static final char V_CHR
public static final java.lang.String F_STR
public static final char F_CHR
public static final java.lang.String A_STR
public static final char A_CHR
public static final boolean FACT
public static final boolean VARIABLE
public static final java.lang.String SELF_NAME
public static final java.lang.String THIS_NAME
public static final java.lang.String THIS
public static final java.lang.String SELF
protected static final int IS_VARIABLE
protected static final int IS_NEGATION
protected static final int IS_READ_ONLY
protected static final int IS_REPLACED
protected static final int IS_LOCAL
protected static final int IS_SIDE_EFFECT
transient ValueFunction functor
transient java.lang.String descp
protected java.lang.String id
protected java.lang.String type
protected int modifiers
protected AttributeList attr
protected OntologyDb ontology
| Constructor Detail |
public Fact()
Fact(boolean is_variable,
java.lang.String type,
OntologyDb ontology,
GenSym genSym)
public Fact(Fact fact)
public Fact(boolean is_variable,
Fact fact)
protected Fact(java.lang.String type,
java.lang.String id,
int modifiers,
AttributeList attr,
OntologyDb ontology)
| Method Detail |
public static final java.lang.String newVar(GenSym genSym)
protected static java.lang.String name(boolean isVariable,
GenSym genSym)
public OntologyDb getOntologyDb()
public TreeNode createAttributeTree(boolean mode)
public static boolean isVariable(int x)
public static boolean isNegative(int x)
public static boolean isReadOnly(int x)
public static boolean isLocal(int x)
public static boolean isReplaced(int x)
public static boolean isSideEffect(int x)
public boolean isVariable()
public boolean isNegative()
public boolean isReadOnly()
public boolean isLocal()
public boolean isReplaced()
public boolean isSideEffect()
public java.lang.String ID()
public java.lang.String getId()
public java.lang.String getType()
public int getModifiers()
public void setId(java.lang.String id)
public void setType(java.lang.String type)
public void setModifiers(int modifiers)
public static int setIsVariable(int x,
boolean set)
public static int setIsNegative(int x,
boolean set)
public static int setIsReadOnly(int x,
boolean set)
public static int setIsLocal(int x,
boolean set)
public static int setIsReplaced(int x,
boolean set)
public static int setIsSideEffect(int x,
boolean set)
public void setIsVariable(boolean set)
public void setIsNegative(boolean set)
public void setIsReadOnly(boolean set)
public void setIsLocal(boolean set)
public void setIsReplaced(boolean set)
public void setIsSideEffect(boolean set)
public java.lang.String[] listAttributes()
public ValueFunction[] listValues()
public ValueFunction[] variables()
public AttributeList getAttributeList()
public java.lang.String getValue(java.lang.String attribute)
public ValueFunction getFn(java.lang.String attribute)
public int getInt(java.lang.String attribute)
public double getDouble(java.lang.String attribute)
public long getLong(java.lang.String attribute)
public int getNumber()
public void setNumber(int x)
public void setNumber(VarFn var1)
public double getNetCost()
public double getUnitCost()
public void setUnitCost(double x)
public void setUnitCost(VarFn var1)
public VarFn newVar()
public void setValue(java.lang.String attribute,
int value)
public void setValue(java.lang.String attribute,
long value)
public void setValue(java.lang.String attribute,
double value)
public void setValue(java.lang.String attribute,
boolean value)
public void setValue(java.lang.String attribute,
java.lang.String value)
public void setValue(java.lang.String attribute,
ValueFunction value)
void setAttributeList(AttributeList List)
public void setValues(java.lang.String[] input)
public boolean equals(java.lang.Object obj)
protected void setFunctor()
public boolean isDeterminate()
public boolean isDeterminate(java.lang.String attribute)
public java.lang.String[] objectAttributeNames()
public java.lang.String toString()
public java.lang.String toSL()
public java.lang.String pprint()
public java.lang.String pprint(int sp)
public java.lang.String printDAML(java.lang.String header,
java.lang.String footer)
public boolean unifiesWith(Fact f,
Bindings bindings)
public boolean unifiesWithChild(Fact f,
Bindings bindings)
public boolean isa(java.lang.String ancestor)
public ValueFunction functor()
public boolean resolve(Bindings bindings)
public boolean resolve(ResolutionContext context,
Bindings bindings)
public boolean disjoin(Fact f)
public Fact duplicate(java.lang.String name,
GenSym genSym)
public Fact duplicate(DuplicationTable table)
public java.lang.String[] buildMap(Fact mapper)
public void doMap(Fact mapper,
java.lang.String[] tmap)
public ValueFunction getVal(int pos)
public void map(Fact toMap)
private void debug(java.lang.String str)
public static void main(java.lang.String[] argv)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||