|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectabsurdist.ConceptSystem
Class ConceptSystem is the data model for a concept system specifying the semantic network between the concepts. It contains all concept categoies and relation models used in the system, as well as all its concepts and relations.
| Field Summary | |
java.util.Vector |
anchors
This is a vector that is either null (if no anchors are in use), or is of the same length as "concepts". |
java.util.Vector |
categories
All concept categories involved in the system. |
java.util.Vector |
concepts
All concepts in the system. |
static int |
DIRECTED
Direction mode for directed relation models. |
static int |
MIXED
Direction mode for a mixture of directed and undirected relation models. |
java.util.Vector |
models
All relation models used in the system. |
java.lang.String |
name
Identifier of the system. |
java.util.Hashtable |
relations
All relation instances in the system. |
static int |
UNDIRECTED
Direction mode for undirected relation models. |
| Constructor Summary | |
ConceptSystem()
Creates an empty concept system. |
|
ConceptSystem(ConceptSystem system)
Creates a copy of a concept system. |
|
ConceptSystem(ConceptSystem system,
double noiseCC,
double noiseCI,
double noiseRC,
double noiseRI)
Creates another concept system by adding some noise to an existing system. |
|
ConceptSystem(Graph graph)
Creates a concept system from a graph instance. |
|
ConceptSystem(int n,
double fullness)
Creates a concept system represented as a random simple graph, with default concepts and default relations. |
|
ConceptSystem(int n,
int nCat,
boolean ranked,
boolean valued,
double fullness,
int nLabel,
int directMode,
boolean weighted)
Creates a concept system represented as a random graph, categorized/randked/valued, directed/weighted/labeled as indicated, with concepts of random categories and ranks, and randomly weighted/labeled relations. |
|
ConceptSystem(java.lang.String name,
java.util.Vector categories,
java.util.Vector models,
java.util.Vector concepts,
java.util.Hashtable relations)
Creates a concept systems with specified contents. |
|
| Method Summary | |
void |
addAnchor(int innerIdx,
java.lang.String leafName)
Adds another "anchor" (information about formerly attached leaf) to the inner node. |
void |
addCategory(java.lang.String category)
Adds a concept category. |
void |
addConcept(Concept concept)
Adds a concept. |
void |
addModel(RelationModel model)
Adds a relation model. |
void |
addNoise(double noiseCC,
double noiseCI,
double noiseRC,
double noiseRI)
Adds some noise to this system. |
int |
allAnchorCnt()
How many anchors are in this system? |
int |
anchorOverlap(ConceptSystem other,
int iHere,
int iOther)
How many achors do Concept i of this system and Concept iother of the other system have in common? This can be used in external similarity computations |
java.lang.String |
getCategory(int i)
Gets the ith concept category. |
int |
getCategoryIndex(java.lang.String category)
Gets the index of a concept category in the system. |
int |
getCategoryNum()
Gets the total number of concept categories in the system. |
Concept |
getConcept(int i)
Gets the ith concept. |
Concept |
getConcept(java.lang.String name)
Gets the concept with the specified name |
int |
getConceptIndex(Concept concept)
Gets the index of a concept in the system. |
int |
getConceptIndex(java.lang.String name)
Gets the index of a concept with the specified name. |
int |
getConceptNum()
Gets the total number of concepts in the system. |
static java.lang.String |
getKey(int i,
int j)
Gets the key for the relations between concept i and j. |
RelationModel |
getModel(int i)
Gets the ith relation model. |
RelationModel |
getModel(java.lang.String label)
Gets the relation model with the specified label. |
int |
getModelIndex(RelationModel model)
Gets the index of a relation model in the system. |
int |
getModelIndex(java.lang.String label)
Gets the index of a relation model with the specified label. |
int |
getModelNum()
Gets the total number of relation models in the system. |
Relation |
getRelation(int i,
int j,
java.lang.String label)
Gets the relation of the specified label between concept i and concept j. |
static Relation |
getRelation(java.util.Vector rellist,
java.lang.String label)
Gets the relation of the specified label in a relation list. |
java.util.Vector |
getRelations(int i,
int j)
Gets the relation list between concept i and concept j. |
int |
getRelListNum()
Gets the total number of relation lists in the system. |
boolean |
isCategorized()
Checks whether this concept system is categorized, i.e. |
boolean |
isDirected()
Checks whether this concept system contains any directed relation models. |
boolean |
isLabeled()
Checks whether this concept system is labeled, i.e. |
boolean |
isRanked()
Checks whether any of the concept in this concept system is ranked. |
boolean |
isSimple()
Checks whether this is a simple system, i.e. |
boolean |
isValued()
Checks whether any of the concept in this concept system is valued. |
boolean |
isWeighted()
Checks whether any of the relation in this concept system is weighted. |
void |
putRelation(int i,
int j,
Relation relation)
Adds the specified relation to the relation list between concept i and concept j. |
static void |
putRelation(java.util.Vector rellist,
Relation relation)
Adds the specified relation to a relation list. |
void |
putRelations(int i,
int j,
java.util.Vector rellist)
Puts the relation list between concept i and concept j. |
static ConceptSystem |
readBin(java.lang.String fileName)
Creates and reads a concept system from a binary file. |
static ConceptSystem |
readTxt(java.lang.String filename)
Creates and reads a concept system from a text file. |
void |
removeRelation(int i,
int j,
Relation relation)
Removes the specified relation from the relation list between concept i and concept j; if this causes the list to be empty, remove the list from the system. |
void |
removeRelations(int i,
int j)
Removes the relation list between concept i and concept j. |
boolean |
simpleConcepts()
Checks whether this concept system contains only simple, i.e. |
boolean |
simpleRelations()
Checks whether this concept system contains only simple, i.e. |
java.lang.String |
toString()
Returns a string representation of this concept system. |
void |
writeBin(java.lang.String fileName)
Writes out the concept systems object into a binary file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int UNDIRECTED
public static final int DIRECTED
public static final int MIXED
public java.lang.String name
public java.util.Vector categories
public java.util.Vector models
public java.util.Vector concepts
public java.util.Hashtable relations
public java.util.Vector anchors
| Constructor Detail |
public ConceptSystem()
public ConceptSystem(java.lang.String name,
java.util.Vector categories,
java.util.Vector models,
java.util.Vector concepts,
java.util.Hashtable relations)
public ConceptSystem(Graph graph)
public ConceptSystem(int n,
double fullness)
throws java.lang.Exception
n - Number of concepts in the system.fullness - Percentage of relations among the total possible relation links in the system.
The value of fullness ranges between [0,1].
public ConceptSystem(int n,
int nCat,
boolean ranked,
boolean valued,
double fullness,
int nLabel,
int directMode,
boolean weighted)
throws java.lang.Exception
n - Number of concepts in the system.nCat - Number of concept categories in the system.ranked - Whether the concepts are rankded.valued - Whether the concepts have feature values.fullness - Percentage of relations among the total possible relation links in the system.nLabel - Number of different relation labels in the system.directMode - Whether the system has directed, undirected, or both types of relations.weighted - Whether the relations are weighted.public ConceptSystem(ConceptSystem system)
public ConceptSystem(ConceptSystem system,
double noiseCC,
double noiseCI,
double noiseRC,
double noiseRI)
noiseCC - Concept noise coverage, i.e. percentage of concepts that are affectednoiseCI - Concept noise intensity, i.e. amount of changes to concept quantitative values (d1 & d2)noiseRC - Relation noise coverage, i.e. percentage of relations that are changed and even invertednoiseRI - Relation noise intensity, i.e. amount of change to relation weight| Method Detail |
public void addNoise(double noiseCC,
double noiseCI,
double noiseRC,
double noiseRI)
noiseCC - Concept noise coverage, i.e. percentage of concepts that are affectednoiseCI - Concept noise intensity, i.e. amount of changes to concept quantitative values (d1 & d2)noiseRC - Relation noise coverage, i.e. percentage of relations that are changed and even invertednoiseRI - Relation noise intensity, i.e. amount of change to relation weightpublic int getCategoryNum()
public int getModelNum()
public int getConceptNum()
public int getRelListNum()
public int getCategoryIndex(java.lang.String category)
public int getModelIndex(RelationModel model)
public int getModelIndex(java.lang.String label)
public int getConceptIndex(Concept concept)
public int getConceptIndex(java.lang.String name)
public java.lang.String getCategory(int i)
public RelationModel getModel(int i)
public RelationModel getModel(java.lang.String label)
public Concept getConcept(int i)
public Concept getConcept(java.lang.String name)
public static java.lang.String getKey(int i,
int j)
public java.util.Vector getRelations(int i,
int j)
public Relation getRelation(int i,
int j,
java.lang.String label)
public static Relation getRelation(java.util.Vector rellist,
java.lang.String label)
public void putRelations(int i,
int j,
java.util.Vector rellist)
public void putRelation(int i,
int j,
Relation relation)
public void addCategory(java.lang.String category)
public void addModel(RelationModel model)
public void addConcept(Concept concept)
public static void putRelation(java.util.Vector rellist,
Relation relation)
public void removeRelations(int i,
int j)
public void removeRelation(int i,
int j,
Relation relation)
public boolean isCategorized()
public boolean isRanked()
public boolean isValued()
public boolean simpleConcepts()
public boolean isLabeled()
public boolean isDirected()
public boolean isWeighted()
public boolean simpleRelations()
public boolean isSimple()
public void addAnchor(int innerIdx,
java.lang.String leafName)
public int allAnchorCnt()
public int anchorOverlap(ConceptSystem other,
int iHere,
int iOther)
public static ConceptSystem readTxt(java.lang.String filename)
throws java.lang.Exception
java.lang.Exception
public static ConceptSystem readBin(java.lang.String fileName)
throws java.lang.Exception
java.lang.Exception
public void writeBin(java.lang.String fileName)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||