public class Database extends Object
The constructor is private as you must not use it. Instead use the
getInstance()
method to get the only object of the class (or to
create it).
updates(RuleSet)
Modifier and Type | Field and Description |
---|---|
private DSet |
dSet |
private FactSet |
factsDatabase |
private static Database |
instance |
private Map<String,Integer> |
limits |
private RuleSet |
rulesDatabase |
Modifier | Constructor and Description |
---|---|
private |
Database()
Constructor of the class.
|
Modifier and Type | Method and Description |
---|---|
void |
addRulesDatabase(List<Rule> rules)
Adds rules to the database.
|
DSet |
getDSet()
Gets the D set of the database.
|
static Database |
getInstance()
This is the method to get an instance of the class.
|
Map<String,Integer> |
getLimits()
Gets the limits of the fluents and the actions.
|
RuleSet |
getRuleSet()
Creates a
RuleSet object that represents the state of the entire
database (intensional and extensional). |
void |
setdSet(DSet dSet)
Sets the domain theory of the database.
|
void |
setFactsDatabase(FactSet factsDatabase)
Sets the facts of the database.
|
void |
setLimits(Map<String,Integer> limits)
Sets the limits of the fluents and the actions.
|
void |
setRulesDatabase(RuleSet rulesDatabase)
Sets the rules of the database.
|
String |
toString()
Returns the database under the form of:
"
DB:
Facts: { }
Rules: {
}
".
|
void |
updates(RuleSet events)
Updates the database when the step cycle asks so.
|
private FactSet factsDatabase
private RuleSet rulesDatabase
private DSet dSet
private static volatile Database instance
private Database()
getInstance()
instead.getInstance()
public static Database getInstance()
Database.getInstance()
Database
.public void setFactsDatabase(FactSet factsDatabase)
factsDatabase
- the facts of the database to setpublic void setRulesDatabase(RuleSet rulesDatabase)
rulesDatabase
- the rules of the database to setpublic void setLimits(Map<String,Integer> limits)
limits
- the mapping between the name of fluents or actions and their
limits.public Map<String,Integer> getLimits()
public void addRulesDatabase(List<Rule> rules)
rules
- the rules to add to the database.public void setdSet(DSet dSet)
dSet
- the D set of the database to setpublic DSet getDSet()
DSet
object representing the D set of the database.public String toString()
toString
in class Object
Object.toString()
public RuleSet getRuleSet()
RuleSet
object that represents the state of the entire
database (intensional and extensional).RuleSet
object containing all the rules of the
database.public void updates(RuleSet events)
CycleState
implementation.events
- the events that have been triggered during the previous cycle.DatabaseUpdateState