multimedia.model
Class OnOffModel

java.lang.Object
  |
  +--multimedia.model.GenericAggregatedModel
        |
        +--multimedia.model.GenericModel
              |
              +--multimedia.model.GenericAudioModel
                    |
                    +--multimedia.model.OnOffModel

public class OnOffModel
extends GenericAudioModel


Field Summary
 int etatDepart
           
 GenericDistribution loi1
           
 GenericDistribution loi2
           
 
Fields inherited from class multimedia.model.GenericAudioModel
codec
 
Constructor Summary
OnOffModel()
           
OnOffModel(int unEtatDepart, GenericDistribution nomLoi1, GenericDistribution nomLoi2, AudioCodec unCodec)
          OnOffModel
 
Method Summary
 double calculT(double etat)
           
 java.lang.String getCompleteName()
           
 double getParam(int unEtat, java.lang.String unParam)
          Recupere la valeur des parametres ou d'un seul
 java.lang.Object getParameter(int idx)
           
 double getParamOn()
          getParamOn : to calculate Pon = beta/(alpha + beta) where alpha = 1/Ton and beta = 1/Toff
static void main(java.lang.String[] args)
          Methode: Main pour tester la classe OnOffModel
 double meanRate()
          meanRate : to calculate mean of generated packet number per second mean = 1/InterPacketTime*Pon = lambda*Pon
 void setOffDistribution(GenericDistribution offDistrib)
           
 void setOnDistribution(GenericDistribution onDistrib)
           
 void setParam(java.lang.String unParam, double uneValeur)
          Positionne la valeur de tous les parametres ou d'un seul
 
Methods inherited from class multimedia.model.GenericAudioModel
getCodec, getEtatCount, getEtatDepart, setCodec, setEtatCount, setEtatDepart
 
Methods inherited from class multimedia.model.GenericAggregatedModel
getName, getParamsCount, setName, setParamsCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

etatDepart

public int etatDepart

loi1

public GenericDistribution loi1

loi2

public GenericDistribution loi2
Constructor Detail

OnOffModel

public OnOffModel()

OnOffModel

public OnOffModel(int unEtatDepart,
                  GenericDistribution nomLoi1,
                  GenericDistribution nomLoi2,
                  AudioCodec unCodec)
           throws java.lang.IllegalArgumentException
OnOffModel

Parameters:
unEtatDepart - it defines the state of the system at the start: it could be 0 or 1
nomLoi1 - it defines the distribution which represents time passed in state 1
nomLoi2 - it defines the distribution which represents time passed in state 2
unCodec - it's the associated Codec
Method Detail

getParam

public double getParam(int unEtat,
                       java.lang.String unParam)
                throws java.lang.IllegalArgumentException
Description copied from class: GenericAudioModel
Recupere la valeur des parametres ou d'un seul

Specified by:
getParam in class GenericAudioModel
java.lang.IllegalArgumentException

setParam

public void setParam(java.lang.String unParam,
                     double uneValeur)
              throws java.lang.IllegalArgumentException
Description copied from class: GenericAudioModel
Positionne la valeur de tous les parametres ou d'un seul

Specified by:
setParam in class GenericAudioModel
java.lang.IllegalArgumentException

getParameter

public java.lang.Object getParameter(int idx)
                              throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException

calculT

public double calculT(double etat)
               throws java.lang.IllegalArgumentException
Specified by:
calculT in class GenericAudioModel
java.lang.IllegalArgumentException

getParamOn

public double getParamOn()
getParamOn : to calculate Pon = beta/(alpha + beta) where alpha = 1/Ton and beta = 1/Toff


meanRate

public double meanRate()
meanRate : to calculate mean of generated packet number per second mean = 1/InterPacketTime*Pon = lambda*Pon

Returns:
mean rate in kbits/s

getCompleteName

public java.lang.String getCompleteName()

setOnDistribution

public void setOnDistribution(GenericDistribution onDistrib)

setOffDistribution

public void setOffDistribution(GenericDistribution offDistrib)

main

public static void main(java.lang.String[] args)
Methode: Main pour tester la classe OnOffModel