public class ReasoningResult
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<net.ssehub.easy.varModel.confModel.IDecisionVariable> |
affected |
private boolean |
hasConflict |
private boolean |
hasTimeout |
private java.util.Map<IMeasurementKey,java.lang.Number> |
measures |
private java.util.List<Message> |
messages |
private boolean |
wasStopped |
| Constructor and Description |
|---|
ReasoningResult()
General constructor for new ReasoningResults.
|
ReasoningResult(java.lang.String reasonerName)
Constructor for a result denoting the the chosen constructor is not able to handle the called operation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAffected(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
Adds a variable affected by reasoning.
|
void |
addMessage(Message message)
Adds a new Message to the current result, e.
|
net.ssehub.easy.varModel.confModel.IDecisionVariable |
getAffectedVariable(int index)
Returns the affected variable specified by
index. |
int |
getAffectedVariablesCount()
Return the number of affected variables.
|
java.lang.Number |
getMeasure(IMeasurementKey key)
Returns the measure for a specific
key. |
Message |
getMessage(int index)
Returns the message specified by
index. |
int |
getMessageCount()
Returns the number of messages related to this reasoning result.
|
boolean |
hasConflict()
Denotes whether this reasoning result represents an error/conflict.
|
boolean |
hasInfo()
Checks whether this result contains any
Status.INFO messages, indicating that the configuration
was changed. |
boolean |
hasTimeout()
Returns whether reasoning was stopped due to a timeout.
|
void |
logInformation(net.ssehub.easy.varModel.model.Project prj,
ReasonerConfiguration.IAdditionalInformationLogger infoLogger,
boolean withMessages)
Logs reasoning summary based on
prj, the measures and the messages. |
void |
logInformation(net.ssehub.easy.varModel.model.Project prj,
ReasonerConfiguration rConfig)
Logs reasoning summary based on
prj, the measures and the messages. |
void |
logInformation(net.ssehub.easy.varModel.model.Project prj,
ReasonerConfiguration rConfig,
boolean withMessages)
Logs reasoning summary based on
prj, the measures and the messages. |
java.util.Set<IMeasurementKey> |
measurementKeys()
Returns all measurement keys.
|
boolean |
providesInformationOnAffectedVariables()
Returns whether information on affected variables is provided.
|
boolean |
reasoningUnsupported()
Returns whether the called reasoning step is supported by this reasoner.
|
void |
setMeasure(IMeasurementKey key,
java.lang.Number value)
Sets a reasoner-specific measure.
|
void |
setStopped(boolean wasStopped)
Changes whether reasoning was stopped due to a user request.
|
void |
setTimeout(boolean hasTimeout)
Changes whether reasoning was stopped due to a timeout.
|
boolean |
wasStopped()
Returns whether reasoning was stopped due to a user request.
|
private java.util.List<net.ssehub.easy.varModel.confModel.IDecisionVariable> affected
private java.util.List<Message> messages
private boolean hasConflict
private boolean hasTimeout
private boolean wasStopped
private java.util.Map<IMeasurementKey,java.lang.Number> measures
public ReasoningResult()
public ReasoningResult(java.lang.String reasonerName)
reasonerName - The name of the reasoner, which was called.public void addAffected(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
var - the affected variablepublic void addMessage(Message message)
message - The new message which should be added to this result.public void setTimeout(boolean hasTimeout)
hasTimeout - true for timeout, false elsepublic void setStopped(boolean wasStopped)
wasStopped - true for stopped, false elsepublic boolean hasTimeout()
true for timeout, false elsepublic boolean wasStopped()
true for stopped, false elsepublic boolean hasConflict()
hasTimeoutpublic boolean hasInfo()
Status.INFO messages, indicating that the configuration
was changed.Status.INFO message, false otherwise.public boolean reasoningUnsupported()
public int getMessageCount()
public Message getMessage(int index)
index.index - a 0-based index specifying the message to be returnedjava.lang.IndexOutOfBoundsException - if
index<0 || index>=getMessageCount()public boolean providesInformationOnAffectedVariables()
true if information of affected variables is provided,
false else (then getAffectedVariablesCount() will always be 0).public int getAffectedVariablesCount()
public net.ssehub.easy.varModel.confModel.IDecisionVariable getAffectedVariable(int index)
index.index - a 0-based index specifying the variable to be returnedjava.lang.IndexOutOfBoundsException - if
index<0 || index>=getAffectedVariablesCount()public void setMeasure(IMeasurementKey key, java.lang.Number value)
key - the key (null is ignored)value - the measure (may be null)public java.lang.Number getMeasure(IMeasurementKey key)
key.key - the key (null is ignored)public java.util.Set<IMeasurementKey> measurementKeys()
public void logInformation(net.ssehub.easy.varModel.model.Project prj,
ReasonerConfiguration rConfig)
prj, the measures and the messages. Reasoners shall not produce
output except for debugging stuff. If explicit output is required, call this method after reasoning. Logs
with reasoner messages by default.prj - the project representing the modelrConfig - the configuration containing the information loggerpublic void logInformation(net.ssehub.easy.varModel.model.Project prj,
ReasonerConfiguration rConfig,
boolean withMessages)
prj, the measures and the messages. Reasoners shall not produce
output except for debugging stuff. If explicit output is required, call this method after reasoning.prj - the project representing the modelrConfig - the configuration containing the information loggerwithMessages - include the reasoner messages (may be time consuming)public void logInformation(net.ssehub.easy.varModel.model.Project prj,
ReasonerConfiguration.IAdditionalInformationLogger infoLogger,
boolean withMessages)
prj, the measures and the messages. Reasoners shall not produce
output except for debugging stuff. If explicit output is required, call this method after reasoning.prj - the project representing the modelinfoLogger - the information loggerwithMessages - include the reasoner messages (may be time consuming)Copyright © 2009 - 2018 SSE. All Rights Reserved.