org.encog.ml.bayesian.query
Class BasicQuery
- java.lang.Object
-
- org.encog.ml.bayesian.query.BasicQuery
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, BayesianQuery
- Direct Known Subclasses:
- EnumerationQuery, SamplingQuery
public abstract class BasicQuery extends java.lang.Object implements BayesianQuery, java.io.Serializable
Provides basic functionality for a Bayesian query. This class is abstract, and is not used directly. Rather, other queries make use of it.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BasicQuery()Default constructor.BasicQuery(BayesianNetwork theNetwork)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description BayesianQueryclone()voiddefineEventType(BayesianEvent event, EventType et)Define an event type to be either hidden(default), evidence(input) or outcome (output).voidfinalizeStructure()java.util.Map<BayesianEvent,EventState>getEvents()EventStategetEventState(BayesianEvent event)Get the event state for a given event.EventTypegetEventType(BayesianEvent event)Get the event type.java.util.List<BayesianEvent>getEvidenceEvents()BayesianNetworkgetNetwork()java.util.List<BayesianEvent>getOutcomeEvents()java.lang.StringgetProblem()voidlocateEventTypes()Called to locate the evidence and outcome events.voidreset()Reset all event types back to hidden.voidsetEventValue(BayesianEvent event, boolean b)Set the event value to a boolean.voidsetEventValue(BayesianEvent event, int d)Set the event value as a class item.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.encog.ml.bayesian.query.BayesianQuery
execute, getProbability
-
-
-
-
Constructor Detail
-
BasicQuery
public BasicQuery()
Default constructor.
-
BasicQuery
public BasicQuery(BayesianNetwork theNetwork)
-
-
Method Detail
-
finalizeStructure
public void finalizeStructure()
- Specified by:
finalizeStructurein interfaceBayesianQuery
-
getNetwork
public BayesianNetwork getNetwork()
- Specified by:
getNetworkin interfaceBayesianQuery- Returns:
- The Bayesian network that we are using this query for.
-
getEvents
public java.util.Map<BayesianEvent,EventState> getEvents()
- Specified by:
getEventsin interfaceBayesianQuery- Returns:
- A mapping of events to event states.
-
getEvidenceEvents
public java.util.List<BayesianEvent> getEvidenceEvents()
- Specified by:
getEvidenceEventsin interfaceBayesianQuery- Returns:
- The evidence events (inputs).
-
getOutcomeEvents
public java.util.List<BayesianEvent> getOutcomeEvents()
- Specified by:
getOutcomeEventsin interfaceBayesianQuery- Returns:
- The outcome events (outputs).
-
locateEventTypes
public void locateEventTypes()
Called to locate the evidence and outcome events.- Specified by:
locateEventTypesin interfaceBayesianQuery
-
reset
public void reset()
Reset all event types back to hidden.- Specified by:
resetin interfaceBayesianQuery
-
defineEventType
public void defineEventType(BayesianEvent event, EventType et)
Define an event type to be either hidden(default), evidence(input) or outcome (output).- Specified by:
defineEventTypein interfaceBayesianQuery- Parameters:
event- The event to define.et- THe new event type.
-
getEventState
public EventState getEventState(BayesianEvent event)
Get the event state for a given event.- Specified by:
getEventStatein interfaceBayesianQuery- Parameters:
event- The event to get the state for.- Returns:
- The event state.
-
getEventType
public EventType getEventType(BayesianEvent event)
Get the event type.- Specified by:
getEventTypein interfaceBayesianQuery- Parameters:
event- The event to check.- Returns:
- The current event type for this event.
-
setEventValue
public void setEventValue(BayesianEvent event, boolean b)
Set the event value to a boolean.- Specified by:
setEventValuein interfaceBayesianQuery- Parameters:
event- The event.b- The value.
-
setEventValue
public void setEventValue(BayesianEvent event, int d)
Set the event value as a class item.- Specified by:
setEventValuein interfaceBayesianQuery- Parameters:
event- The event to set.d- An integer class item.
-
getProblem
public java.lang.String getProblem()
- Specified by:
getProblemin interfaceBayesianQuery- Returns:
- Return a string that represents this query as a probability "problem".
-
clone
public BayesianQuery clone()
- Specified by:
clonein interfaceBayesianQuery- Overrides:
clonein classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG