reasoner
Class KnowledgeBase

java.lang.Object
  extended by reasoner.KnowledgeBase
All Implemented Interfaces:
java.io.Serializable

public class KnowledgeBase
extends java.lang.Object
implements java.io.Serializable

This class represents a knowledge base as a container of Concepts, ConcreteConcepts, Individuals, ULineEvents, Roles, Quantifiers and one Query

Author:
marco furlan
See Also:
Serialized Form

Field Summary
private  java.util.HashMap<java.lang.String,Concept> concepts
          The Concept map
private  java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts
          The ConcreteConcept map
private  java.util.HashMap<java.lang.String,Individual> individuals
          The Individual map
private  double NOW
          The constant NOW
private  java.util.HashMap<java.lang.String,Quantifier> quantifiers
          The Quantifier map
private  Query query
          The Query
private  java.util.HashMap<java.lang.String,Role> roles
          The role map
private  double SELF
          The constant SELF
private  java.util.HashMap<java.lang.String,ULineEvent> uLineEvents
          The ULineEvent map
 
Constructor Summary
KnowledgeBase()
          Constructor for a new empty Knowledge Base as a container of empty HashMaps of Concepts, ConcreteConcepts, Individuals, ULineEvents, Roles and Quantifiers and with a null Query
KnowledgeBase(java.util.HashMap<java.lang.String,Concept> concepts, java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts, java.util.HashMap<java.lang.String,Individual> individuals, java.util.HashMap<java.lang.String,ULineEvent> uLineEvents, java.util.HashMap<java.lang.String,Role> roles, java.util.HashMap<java.lang.String,Quantifier> quantifiers)
          Constructor for a new Knowledge Base from given HashMaps of elements
KnowledgeBase(java.util.HashMap<java.lang.String,Concept> concepts, java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts, java.util.HashMap<java.lang.String,Individual> individuals, java.util.HashMap<java.lang.String,ULineEvent> uLineEvents, java.util.HashMap<java.lang.String,Role> roles, java.util.HashMap<java.lang.String,Quantifier> quantifiers, Query query)
          Constructor for a new Knowledge Base from given HashMaps of elements
 
Method Summary
 void addConcept(Concept c)
          Adds a Concept to this KB
 void addConcreteConcept(ConcreteConcept tc)
          Adds a ConcreteConcept to this KB
 void addIndividual(Individual i)
          Adds an Individual to this KB
 void addQuantifier(Quantifier q)
          Adds a Quantifier to this KB
 void addRole(Role r)
          Adds a Role to this KB
 void addULineEv(ULineEvent ul)
          Adds an ULineEvent to this KB
 void clear()
          Clears all the maps in this KB
 java.util.HashMap<java.lang.String,Concept> getConcepts()
           
 java.util.HashMap<java.lang.String,ConcreteConcept> getConcrConcepts()
           
 java.util.HashMap<java.lang.String,Individual> getIndividuals()
           
 double getNOW()
           
 java.util.HashMap<java.lang.String,Quantifier> getQuantifiers()
           
 Query getQuery()
           
 java.util.HashMap<java.lang.String,Role> getRoles()
           
 double getSELF()
           
 java.util.Set<java.lang.Double> getTimeSet()
          Gives the total time set
 java.util.HashMap<java.lang.String,ULineEvent> getULineEvents()
           
 void setConcepts(java.util.HashMap<java.lang.String,Concept> concepts)
           
 void setConcrConcepts(java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts)
          sets the HashMap of ConcreteConcepts
 void setIndividuals(java.util.HashMap<java.lang.String,Individual> individuals)
           
 void setQuantifiers(java.util.HashMap<java.lang.String,Quantifier> quantifiers)
           
 void setQuery(Query query)
           
 void setRoles(java.util.HashMap<java.lang.String,Role> roles)
           
 void setULineEvents(java.util.HashMap<java.lang.String,ULineEvent> uLineEvents)
           
 java.lang.String toString()
          Gives a String representation for this KB
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

concepts

private java.util.HashMap<java.lang.String,Concept> concepts
The Concept map


concrConcepts

private java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts
The ConcreteConcept map


individuals

private java.util.HashMap<java.lang.String,Individual> individuals
The Individual map


uLineEvents

private java.util.HashMap<java.lang.String,ULineEvent> uLineEvents
The ULineEvent map


roles

private java.util.HashMap<java.lang.String,Role> roles
The role map


quantifiers

private java.util.HashMap<java.lang.String,Quantifier> quantifiers
The Quantifier map


query

private Query query
The Query


NOW

private final double NOW
The constant NOW

See Also:
Constant Field Values

SELF

private final double SELF
The constant SELF

See Also:
Constant Field Values
Constructor Detail

KnowledgeBase

public KnowledgeBase()
Constructor for a new empty Knowledge Base as a container of empty HashMaps of Concepts, ConcreteConcepts, Individuals, ULineEvents, Roles and Quantifiers and with a null Query


KnowledgeBase

public KnowledgeBase(java.util.HashMap<java.lang.String,Concept> concepts,
                     java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts,
                     java.util.HashMap<java.lang.String,Individual> individuals,
                     java.util.HashMap<java.lang.String,ULineEvent> uLineEvents,
                     java.util.HashMap<java.lang.String,Role> roles,
                     java.util.HashMap<java.lang.String,Quantifier> quantifiers)
Constructor for a new Knowledge Base from given HashMaps of elements

Parameters:
concepts - the HashMap of Concept names and Concepts
concrConcepts - the HashMap of ConcreteConcept names and ConcreteConcepts
individuals - the HashMap of Individual names and Individuals
uLineEvents - the HashMap of ULineEvent names and ULineEvents
roles - the HashMap of Role names and Roles
quantifiers - the HashMap of Quantifier names and Quantifiers

KnowledgeBase

public KnowledgeBase(java.util.HashMap<java.lang.String,Concept> concepts,
                     java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts,
                     java.util.HashMap<java.lang.String,Individual> individuals,
                     java.util.HashMap<java.lang.String,ULineEvent> uLineEvents,
                     java.util.HashMap<java.lang.String,Role> roles,
                     java.util.HashMap<java.lang.String,Quantifier> quantifiers,
                     Query query)
Constructor for a new Knowledge Base from given HashMaps of elements

Parameters:
concepts - the HashMap of Concept names and Concepts
concrConcepts - the HashMap of ConcreteConcept names and ConcreteConcepts
individuals - the HashMap of Individual names and Individuals
uLineEvents - the HashMap of ULineEvent names and ULineEvents
roles - the HashMap of Role names and Roles
quantifiers - the HashMap of Quantifier names and Quantifiers
query - the given Query
Method Detail

getTimeSet

public java.util.Set<java.lang.Double> getTimeSet()
Gives the total time set

Returns:
the time set

addRole

public void addRole(Role r)
Adds a Role to this KB

Parameters:
r - the Role

addQuantifier

public void addQuantifier(Quantifier q)
Adds a Quantifier to this KB

Parameters:
q - the Quantifier

addConcept

public void addConcept(Concept c)
Adds a Concept to this KB

Parameters:
c - the concept to add

addULineEv

public void addULineEv(ULineEvent ul)
Adds an ULineEvent to this KB

Parameters:
ul - the ULineEvent to add

addIndividual

public void addIndividual(Individual i)
Adds an Individual to this KB

Parameters:
i - the Individual to add

addConcreteConcept

public void addConcreteConcept(ConcreteConcept tc)
Adds a ConcreteConcept to this KB

Parameters:
tc - the ConcreteConcept

getQuantifiers

public java.util.HashMap<java.lang.String,Quantifier> getQuantifiers()
Returns:
the HashMap of Quantifiers

setQuantifiers

public void setQuantifiers(java.util.HashMap<java.lang.String,Quantifier> quantifiers)
Parameters:
quantifiers - the HashMap of Quantifiers to set

getConcepts

public java.util.HashMap<java.lang.String,Concept> getConcepts()
Returns:
the HashMap of Concepts

setConcepts

public void setConcepts(java.util.HashMap<java.lang.String,Concept> concepts)
Parameters:
concepts - the HashMap of Concepts to set

getRoles

public java.util.HashMap<java.lang.String,Role> getRoles()
Returns:
the HashMap of Roles

setRoles

public void setRoles(java.util.HashMap<java.lang.String,Role> roles)
Parameters:
roles - the HashMap of Roles to set

getULineEvents

public java.util.HashMap<java.lang.String,ULineEvent> getULineEvents()
Returns:
the HashMap of uLineEvents in this KB

setULineEvents

public void setULineEvents(java.util.HashMap<java.lang.String,ULineEvent> uLineEvents)
Parameters:
uLineEvents - the HashMap of uLineEvents to set in this KB

getConcrConcepts

public java.util.HashMap<java.lang.String,ConcreteConcept> getConcrConcepts()
Returns:
the concrConcepts, the HashMap of ConcreteConcepts

setConcrConcepts

public void setConcrConcepts(java.util.HashMap<java.lang.String,ConcreteConcept> concrConcepts)
sets the HashMap of ConcreteConcepts

Parameters:
concrConcepts - the HashMap of concrConcepts

getIndividuals

public java.util.HashMap<java.lang.String,Individual> getIndividuals()
Returns:
individuals, the HashMap of Individuals

setIndividuals

public void setIndividuals(java.util.HashMap<java.lang.String,Individual> individuals)
Parameters:
individuals - the HashMap of Individuals to set

getQuery

public Query getQuery()
Returns:
the Query

setQuery

public void setQuery(Query query)
Parameters:
query - the Query to set

getNOW

public double getNOW()
Returns:
the constant NOW

getSELF

public double getSELF()
Returns:
the constant SELF

clear

public void clear()
Clears all the maps in this KB


toString

public java.lang.String toString()
Gives a String representation for this KB

Overrides:
toString in class java.lang.Object
Returns:
the String representation