Class InfoControl

    • Constructor Detail

      • InfoControl

        public InfoControl​(@NonNull
                           MyContexts myContexts,
                           MessageContextRepository repository)
        Creates an InfoControl class instance
        Parameters:
        myContexts - the container of user contexts list
        repository - 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 list
        trustManager - the TrustManager
        repository - the repository of messages
    • Method Detail

      • addMessageContext

        public void addMessageContext​(MessageContext messageContext)
        Adds the MessageContext data into the training database for information overload control.
        Specified by:
        addMessageContext in interface InformationOverloadControl
        Parameters:
        messageContext - the MessageContext
      • getMessageImportance

        public int getMessageImportance​(@NonNull
                                        MessageInfo messageInfo,
                                        @NonNull
                                        Context context)
        Gets message importance in a context.
        Specified by:
        getMessageImportance in interface InformationOverloadControl
        Parameters:
        messageInfo - the message
        context - the context
        Returns:
        the importance value
      • 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 interface InformationOverloadControl
        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 name
        context - 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