reasoner
Class ULineEvent

java.lang.Object
  extended by reasoner.Concept
      extended by reasoner.Dynamic
          extended by reasoner.Event
              extended by reasoner.ULineEvent
All Implemented Interfaces:
java.lang.Comparable<Concept>, FuzzySet

public class ULineEvent
extends Event
implements java.lang.Comparable<Concept>

This class represents the Concept of individuals being the events corresponding to the same ULine; it contains, for sake of simplicity, the corresponding ULine too.

Author:
marco furlan

Field Summary
private  java.util.TreeMap<java.lang.Double,Individual> timeMap
          the time map
 
Fields inherited from class reasoner.Concept
events, formatter, kb, NOW, SELF, staticMap, uLineMap
 
Constructor Summary
ULineEvent(java.lang.String name, KnowledgeBase kb)
          Constructor by name and KnowledgeBase
 
Method Summary
 void add(java.lang.Double time, Individual i)
          Adds an Individual and it's time in this ULineEvent
 int compareTo(Concept i)
           
 Individual firstMax(Concept a)
          Returns the Individual corrisponding on the first maximum value on the Concept a
 double get(double time, Concept c)
          Returns the concept membership value for the individual belonging this ULineEvent, corresponding to given time.
 Individual getFirst()
          Gets the first Individual in this ULineEvent, ordered by time, or null if this ULineEvent is empty.
 Individual getIndividual(java.lang.Double time)
          Gets Individual with a given time
 Individual getLast()
          Gets the last Individual in this ULineEvent, ordered by time, or null if this ULineEvent is empty.
 ULineInd getMyULine()
          Returns ULineInd corresponding to this ULineEvent
 Individual getNext(Individual ind)
          Gets next Individual, after given Individual, in this ULineEvent, ordered by time, or null if next Individual does not exist.
 Individual getPrevious(Individual ind)
          Returns previous Individual, in time ordering, before given Individual or null if such previous Individual does not exist.
 java.util.TreeMap<java.lang.Double,Individual> getTimeMap()
           
 java.util.TreeSet<java.lang.Double> getTimeSet()
           
 ULineEvent getWithoutLast()
          Returns a new ULineEvent identical to the present one, except for the last Individual that is missing
 Individual lastMax(Concept a)
          Returns the Individual corrisponding on the last maximum value on the Concept a
 double max(Concept a)
          Gets the maximum value gained by this ULineEvent on a given Concept
 void print()
          Prints on the standard output a String representation for this Concept, with all EventInds and values.
 void setTimeMap(java.util.TreeMap<java.lang.Double,Individual> timeMap)
           
private  void setULine()
          Creates a new ULine for this ULineEvent
 java.lang.String toString()
           
 
Methods inherited from class reasoner.Concept
add, always, card, containsIndivName, containsKey, get, getAlwaysMap, getEvents, getEvKeys, getKb, getLambda, getName, getNextConcept, getNOW, getSELF, getSometimeMap, getStaticMap, getULineMap, getUlKeys, getUlLambda, interpole, intersection, printUlines, setAlwaysMap, setEvents, setKb, setName, setNOW, setSELF, setSometimeMap, setStaticMap, setULineMap, sometime, subsumed, subsumed, totalLambda, totalUlLambda, until, until
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timeMap

private java.util.TreeMap<java.lang.Double,Individual> timeMap
the time map

Constructor Detail

ULineEvent

public ULineEvent(java.lang.String name,
                  KnowledgeBase kb)
Constructor by name and KnowledgeBase

Parameters:
name - the name
kb - the KnowledgeBase
Method Detail

max

public double max(Concept a)
Gets the maximum value gained by this ULineEvent on a given Concept

Parameters:
a - the Concept
Returns:
the maximum value

getFirst

public Individual getFirst()
Gets the first Individual in this ULineEvent, ordered by time, or null if this ULineEvent is empty.

Returns:
the first Individual or null

getLast

public Individual getLast()
Gets the last Individual in this ULineEvent, ordered by time, or null if this ULineEvent is empty.

Returns:
the last Individual or null

getNext

public Individual getNext(Individual ind)
Gets next Individual, after given Individual, in this ULineEvent, ordered by time, or null if next Individual does not exist.

Parameters:
ind - the given Individual
Returns:
next Individual

get

public double get(double time,
                  Concept c)
Returns the concept membership value for the individual belonging this ULineEvent, corresponding to given time.

Parameters:
time - the time
c - the Concept
Returns:
the Concept membership value

getPrevious

public Individual getPrevious(Individual ind)
Returns previous Individual, in time ordering, before given Individual or null if such previous Individual does not exist.

Parameters:
ind - the given Individual
Returns:
the previous Individual

getWithoutLast

public ULineEvent getWithoutLast()
Returns a new ULineEvent identical to the present one, except for the last Individual that is missing

Returns:
the ULineEvent

firstMax

public Individual firstMax(Concept a)
Returns the Individual corrisponding on the first maximum value on the Concept a

Parameters:
a - the Concept
Returns:
the Individual

lastMax

public Individual lastMax(Concept a)
Returns the Individual corrisponding on the last maximum value on the Concept a

Parameters:
a - the Concept
Returns:
the Individual

print

public void print()
Description copied from class: Concept
Prints on the standard output a String representation for this Concept, with all EventInds and values.

Overrides:
print in class Concept

toString

public java.lang.String toString()
Overrides:
toString in class Concept
Returns:
a String representation for this Concept, with all EventInds and values

setULine

private void setULine()
Creates a new ULine for this ULineEvent


add

public void add(java.lang.Double time,
                Individual i)
Adds an Individual and it's time in this ULineEvent

Parameters:
time - the time
i - the Individual

getTimeSet

public java.util.TreeSet<java.lang.Double> getTimeSet()
Returns:
the time set

getTimeMap

public java.util.TreeMap<java.lang.Double,Individual> getTimeMap()
Returns:
the timeMap

setTimeMap

public void setTimeMap(java.util.TreeMap<java.lang.Double,Individual> timeMap)
Parameters:
timeMap - the timeMap to set

getIndividual

public Individual getIndividual(java.lang.Double time)
Gets Individual with a given time

Parameters:
time - the time
Returns:
the Individual

compareTo

public int compareTo(Concept i)
Specified by:
compareTo in interface java.lang.Comparable<Concept>

getMyULine

public ULineInd getMyULine()
Returns ULineInd corresponding to this ULineEvent

Returns:
the ULineInd