Package edu.cmu.tetrad.data
Class KnowledgeGroup
java.lang.Object
edu.cmu.tetrad.data.KnowledgeGroup
- All Implemented Interfaces:
TetradSerializable,Serializable
Represents a "Other Group" in Knowledge, which can be understood as: Group1 -> Group2 where there are edges
between all members of Group1 to Group2.
Immutable.
- Version:
- $Id: $Id
- Author:
- Tyler Gibson
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKnowledgeGroup(int type) Constructs an empty instance of a knowledge group.KnowledgeGroup(int type, Set<String> from, Set<String> to) Constructs a group given the type. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsEdge(KnowledgeEdge edge) containsEdge.booleangetEdges()getEdges.getFromVariables.getToVariables.intgetType()Getter for the fieldtype.inthashCode()Computes a hashcode.booleanisEmpty()States whether this group is empty, that is there is no edges in it (Note there may be some partial information though).static KnowledgeGroupGenerates a simple exemplar of this class to test serialization.
-
Field Details
-
REQUIRED
public static final int REQUIREDThe types of groups (Can an enum be used instead?)- See Also:
-
FORBIDDEN
public static final int FORBIDDENConstantFORBIDDEN=2- See Also:
-
-
Constructor Details
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
KnowledgeGroupobject
-
getType
public int getType()Getter for the field
type.- Returns:
- a int
-
isEmpty
public boolean isEmpty()States whether this group is empty, that is there is no edges in it (Note there may be some partial information though).- Returns:
- a boolean
-
getFromVariables
getFromVariables.
- Returns:
- a
Setobject
-
getToVariables
getToVariables.
- Returns:
- a
Setobject
-
getEdges
getEdges.
- Returns:
- - edges.
-
containsEdge
containsEdge.
- Parameters:
edge- aKnowledgeEdgeobject- Returns:
- a boolean
-
hashCode
public int hashCode()Computes a hashcode. -
equals
Equals when they are the same type and have the same edges.
-