Class InfoControl
- java.lang.Object
-
- eu.h2020.helios_social.core.info_control.InfoControl
-
- All Implemented Interfaces:
InformationOverloadControl
public class InfoControl extends java.lang.Object implements InformationOverloadControl
InfoControl class implements the InformationOverloadControl interface.- See Also:
InformationOverloadControl
-
-
Constructor Summary
Constructors Constructor Description InfoControl(MyContexts myContexts, MessageContextRepository repository)
Creates an InfoControl class instanceInfoControl(MyContexts myContexts, eu.h2020.helios_social.core.trustmanager.TrustManager trustManager, MessageContextRepository repository)
Creates an InfoControl class instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessageContext(MessageContext messageContext)
Adds the MessageContext data into the training database for information overload control.java.util.List<Context>
getActiveContexts()
Returns currently active contexts in the scope of the InfoControljava.util.List<ContextProbability>
getContextProbabilities(MessageInfo messageInfo)
Estimates context probabilities for a messagejava.util.List<MessageImportance>
getMessageImportance(MessageInfo messageInfo)
Get message importances in all user contextsint
getMessageImportance(MessageInfo messageInfo, Context context)
Gets message importance in a context.MyContexts
getMyContexts()
Returns the related contextual scope of the InfoControldouble
getTrust(java.lang.String alter, Context context)
Gets the trust value of an Alter in a Contextvoid
readMessage(MessageInfo message)
Notifies InformationOverloadControl about a read message.void
sendMessage(java.lang.String to, java.lang.String topic, java.lang.String message)
Notifies InformationOverloadControl about a sent message.void
setWeights(double context_weight, double trust_weight, double reactiontime_weight, double importance_weight, double number_weight)
Set weights for importance calculation
-
-
-
Constructor Detail
-
InfoControl
public InfoControl(@NonNull MyContexts myContexts, MessageContextRepository repository)
Creates an InfoControl class instance- Parameters:
myContexts
- the container of user contexts listrepository
- the repository of messages
-
InfoControl
public InfoControl(@NonNull MyContexts myContexts, eu.h2020.helios_social.core.trustmanager.TrustManager trustManager, MessageContextRepository repository)
Creates an InfoControl class instance- Parameters:
myContexts
- the container of user contexts listtrustManager
- the TrustManagerrepository
- the repository of messages
-
-
Method Detail
-
getContextProbabilities
public java.util.List<ContextProbability> getContextProbabilities(MessageInfo messageInfo)
Estimates context probabilities for a message- Specified by:
getContextProbabilities
in interfaceInformationOverloadControl
- Parameters:
messageInfo
- the message- Returns:
- the ContextProbability list
-
addMessageContext
public void addMessageContext(MessageContext messageContext)
Adds the MessageContext data into the training database for information overload control.- Specified by:
addMessageContext
in interfaceInformationOverloadControl
- Parameters:
messageContext
- the MessageContext
-
getMessageImportance
public int getMessageImportance(@NonNull MessageInfo messageInfo, @NonNull Context context)
Gets message importance in a context.- Specified by:
getMessageImportance
in interfaceInformationOverloadControl
- Parameters:
messageInfo
- the messagecontext
- the context- Returns:
- the importance value
-
getMessageImportance
public java.util.List<MessageImportance> getMessageImportance(MessageInfo messageInfo)
Description copied from interface:InformationOverloadControl
Get message importances in all user contexts- Specified by:
getMessageImportance
in interfaceInformationOverloadControl
- Parameters:
messageInfo
- the message- Returns:
- the list of MessageImportances, which contains (Context, importance) pairs
-
sendMessage
public void sendMessage(java.lang.String to, java.lang.String topic, java.lang.String message)
Notifies InformationOverloadControl about a sent message. The sent message information is then stored into the MessageContextDatabase.- Parameters:
to
-topic
-message
-
-
readMessage
public void readMessage(MessageInfo message)
Description copied from interface:InformationOverloadControl
Notifies InformationOverloadControl about a read message. The read message information is then stored into the MessageContextDatabase.- Specified by:
readMessage
in interfaceInformationOverloadControl
- Parameters:
message
- the read message (MessageInfo)
-
setWeights
public void setWeights(double context_weight, double trust_weight, double reactiontime_weight, double importance_weight, double number_weight)
Set weights for importance calculation- Parameters:
context_weight
-trust_weight
-reactiontime_weight
-importance_weight
-number_weight
-
-
getTrust
public double getTrust(@NonNull java.lang.String alter, @NonNull Context context)
Gets the trust value of an Alter in a Context- Parameters:
alter
- the Alter namecontext
- the Context- Returns:
- the trust value (-1.0 if unknown)
-
getMyContexts
public MyContexts getMyContexts()
Returns the related contextual scope of the InfoControl- Returns:
- MyContexts
-
getActiveContexts
public java.util.List<Context> getActiveContexts()
Returns currently active contexts in the scope of the InfoControl- Returns:
- the list of ctive contexts
-
-