mapping.data
Class MessageToServer

java.lang.Object
  extended by mapping.data.MessageToServer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MessageToServer
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class is an configuration message sent to servers (Puller objects) to configure them.

Author:
Majd Kokaly
See Also:
Serialized Form

Field Summary
static int NON_ACTIVE_MODE
          Representing the use of neither availability prediction methods.
static int RECURSIVE_MODE
          Representing method 2 in availability prediction.
static int WEIGHTED_MODE
          Representing method 1 in availability prediction.
 
Constructor Summary
MessageToServer()
           
MessageToServer(double percentage, double forHowLong, int availabilityMode, double[] weights, int n, int c)
           
 
Method Summary
 java.lang.Object clone()
           
 double getAvailability()
           
 int getAvailabilityMode()
           
 double getC()
           
 double getForHowLong()
           
 int getN()
           
 double[] getWeights()
           
 void setAvailability(double availability)
           
 void setAvailabilityMode(int availabilityMode)
           
 void setC(double c)
           
 void setForHowLong(double forHowLong)
           
 void setN(int n)
           
 void setWeights(double[] weights)
           
 java.lang.String toString()
          returns the message to be sent to servers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WEIGHTED_MODE

public static final int WEIGHTED_MODE
Representing method 1 in availability prediction. Please refer to Section Availability model in the thesis document.

See Also:
Constant Field Values

RECURSIVE_MODE

public static final int RECURSIVE_MODE
Representing method 2 in availability prediction. Please refer to Section Availability model in the thesis document.

See Also:
Constant Field Values

NON_ACTIVE_MODE

public static final int NON_ACTIVE_MODE
Representing the use of neither availability prediction methods. Please refer to Section Availability Model in the thesis document.

See Also:
Constant Field Values
Constructor Detail

MessageToServer

public MessageToServer()

MessageToServer

public MessageToServer(double percentage,
                       double forHowLong,
                       int availabilityMode,
                       double[] weights,
                       int n,
                       int c)
Method Detail

getAvailability

public double getAvailability()

setAvailability

public void setAvailability(double availability)

getForHowLong

public double getForHowLong()

setForHowLong

public void setForHowLong(double forHowLong)

getAvailabilityMode

public int getAvailabilityMode()

setAvailabilityMode

public void setAvailabilityMode(int availabilityMode)

getWeights

public double[] getWeights()

setWeights

public void setWeights(double[] weights)

getN

public int getN()

setN

public void setN(int n)

getC

public double getC()

setC

public void setC(double c)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
returns the message to be sent to servers. The format is: #percentage#forHowLong#AvailabilityManagerMode#N#Weights#C

Overrides:
toString in class java.lang.Object