multimedia.generation
Class AggregateMGInfFlowGeneration

java.lang.Object
  |
  +--multimedia.generation.GenericGeneration
        |
        +--multimedia.generation.AggregateMGInfFlowGeneration
All Implemented Interfaces:
AudioCodecExample, multimedia.codec.AudioCodecRTPIP, multimedia.MovieExample, MyFormatterDefinitions, MyUnitDefinitions, RandomGenerator, multimedia.codec.VideoCodecEurope, VideoCodecExample, VideoExample

public class AggregateMGInfFlowGeneration
extends GenericGeneration
implements RandomGenerator, AudioCodecExample, VideoExample, VideoCodecExample, MyFormatterDefinitions


Field Summary
protected  VideoCodec[] codecs
           
protected  java.lang.String[] docNames
           
protected  int[] flowsDuration
           
 java.io.File[] flowsFile
           
protected  int flowsNumber
           
protected  MGInfGeneration[] mginfGeneration
           
protected  MGInfModel[] models
           
protected  int N
           
protected  int nbDifferentFlow
           
protected  int[] packetSize
           
protected  double realRate
           
protected  int simulationDuration
           
protected  double slotDuration
           
protected  double[] slotsDuration
           
protected  int[] slotsNumber
           
protected  int[] startingTime
           
protected  java.lang.String testName
           
protected  java.util.TreeMap[] tM
           
protected  short[] units
           
protected  int[] weights
           
 
Fields inherited from class multimedia.generation.GenericGeneration
fichierReq, fileName, graphic, resultFile, tpsSimul, unit
 
Fields inherited from interface statistic.RandomGenerator
random
 
Fields inherited from interface multimedia.codec.AudioCodecExample
G711, G723_1, G726, G728, G729
 
Fields inherited from interface multimedia.VideoExample
BeanHigh, BeanLow, BeanMedium, coeffDistbh, coeffDistbm, coeffDistjph, coeffDistjpm, coeffFuncbh, coeffFuncbl, coeffFuncbm, coeffFuncjph, coeffFuncjpl, coeffFuncjpm, dbh, dbm, djph, djpm, dPacketSize, dSlot, gdbh, gdbm, gdjph, gdjpm, gfbh, gfjpl, gftbh, gftbl, gftbm, gftjph, gftjpl, gftjpm, JurassicParkHigh, JurassicParkLow, JurassicParkMedium, mginfbh, mginfbl, mginfbm, mginfjph, mginfjpl, mginfjpm
 
Fields inherited from interface multimedia.codec.VideoCodecExample
H261, MJPEG, MPEG, MPEG4
 
Fields inherited from interface utils.definitions.MyFormatterDefinitions
myDebitFormatter, myIAFormatter, mySizeFormatter, myTimeFormatter
 
Fields inherited from interface utils.definitions.MyUnitDefinitions
BYTES, GIGABYTES, KILOBYTES, MEGABYTES
 
Constructor Summary
AggregateMGInfFlowGeneration(MGInfModel[] models, VideoCodec[] codecs, int[] weights, int[] flowsDuration, int[] startingTime, short[] units, java.lang.String fileName, boolean graphic)
          You could specify everything you want
AggregateMGInfFlowGeneration(VideoDefinition[] vds, int[] weights, int[] startingTime, short[] units, java.lang.String fileName, boolean graphic)
          Defined to used VideoDefinition like JurassicParkLow,...
 
Method Summary
 void aggregatedScenarioGeneration()
          To generate an aggregated scenario from an AggregateMGInfFlowGeneration object And a scenario file per flow type => + nbDifferentFlow scenarii
 void aggregatedScenarioGeneration(java.lang.String serverName, int serverPort)
          To generate an aggregated scenario with statistics informations from an AggregateMGInfFlowGeneration object And an informative scenario file per flow type => + nbDifferentFlow scenarii
 MGInfGeneration[] createSingleFlowGenerator()
          Method createSingleFlowGenerator : To create MGInfGeneration object from model,flowsDuration,codecs...
 int[] dataPerSlotDistribution()
          Sums all data amount of sources slot per slot
 int[][] dataPerSlotPerFlowType()
          Method dataPerSlotPerFlowType : This method permit to compute data per slot distribution for one type of source After we transform the result according to unit and number of source of this type => ex: if unit: kiloBytes -> Bytes and if there is 5 sources of this type data[i] = data[i]*5
 double flowScenariiGeneration()
           
 double flowScenariiGeneration(java.lang.String serverName, int serverPort)
          Returns theoritical throughput of the aggregated flow => =sum( w1*throughputi) where i =1...ndDifferentFlow
Create nbDifferentFlow scenario files
 java.lang.String getDocumentNames()
          Returns a String which discribes the different flows as: model name or document name(if it exists) (source number)
 int getFlowsNumber()
          Mehod getFlowsNumber : To compute the number of sources => nb = w1 + w2 + ...
 int[] getFlowsPacketSize()
           
protected  int getNewSlotDurationReference()
          Works a slot duration of "reference" out : this value corresponds to mcm of slotsDuration[i]
 double getTheoriticalAggregatedFlowRate()
          Returns throughput of aggregatedFlow in kb/s
 double getTheoriticalTransmittedDataAmount()
          Returns theoritical transmitted data amount during the generation phase in MB
 int getTheoriticalTransmittedDataAmountBis()
          Returns theoritical transmitted data amount during the generation phase (in MBytes)
 int getTheoriticalTransmittedDataAmountTest(int[] slot)
           
 void initializedParameters()
          This permit to initialized some parameters!!!
static void main(java.lang.String[] args)
          Methode: Main pour tester la classe
 void scenarioGeneration()
          Create a "playable" scenario file of the aggregated flow
 void scenarioGeneration(java.lang.String serverName, int portNumber)
          Create an "informative" scenario file of the aggregated flow Return a file formated as follow:
date : serverName
Requested documents : reqDoc
Videos aggregation Test Duration : tpsSimul mn Port Number : serverPort
date: t + testTime s, IA : interpacketIime : 0.000000 s
protected  double scenarioGenericGeneration(boolean playable, java.lang.String serverName, int serverPort)
          Creates either a playable scenario file or an informative one.
 void setNewSlotNumber()
          Method setNewSlotNumber : To set the number of slots for the aggregated flow => N
 void setSlotsDuration()
          Method setSlotsDuration : set the duration of a slot for each source type
 void setSlotsNumber()
          Method setSlotsNumber : To set the number of slots of each source type
 int simulationDurationComputation()
          Method simulationDurationComputation : To compute the duration of the aggregated flow according to "starting time" scenario
protected  int[][] slotDurationStandardization()
          Transforms a flowi type definition([slot durationi, slot numberi]) in order to obtain a flow representation as follow: ([ reference slot duration, new slot numberi])
protected  int[][] slotNumberStandardization()
          Transforms a source i definition([ reference slot duration, new slot numberi]) in order to obtain a flow representation as follow:
([ reference slot duration, reference slot number])
 int sourceTypeChoice()
          To determine which source type send packets at one moment We define this method because flows have different characteristics notably packet size
protected  int[] transformStartingTimeInSlotsNumber()
          This method convert a table of starting time in ms in a table of value in number of slots If slot duration = 10ms, 20 ms corresponds to 2 slots for example Here: startingTime it's a table which contains starting time of each source in ms
protected  int[] transformStartingTimeInSlotsNumber(double slotDurationReference)
          This method convert a table of starting time in: ms in a table of value in: number of slots If slot duration = 10ms, 20 ms corresponds to 2 slots for example
 
Methods inherited from class multimedia.generation.GenericGeneration
changeScenarioFileExtension, getDuration, getGeneratedPacketNumber, getGraphicMode, getResultFileName, getResultFileSize, getUnit, getUnit, setDuration, setGraphicMode, setResultFile, setUnit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flowsDuration

protected int[] flowsDuration

simulationDuration

protected int simulationDuration

codecs

protected VideoCodec[] codecs

models

protected MGInfModel[] models

weights

protected int[] weights

units

protected short[] units

startingTime

protected int[] startingTime

slotsNumber

protected int[] slotsNumber

slotsDuration

protected double[] slotsDuration

nbDifferentFlow

protected final int nbDifferentFlow

flowsNumber

protected int flowsNumber

packetSize

protected int[] packetSize

docNames

protected java.lang.String[] docNames

mginfGeneration

protected MGInfGeneration[] mginfGeneration

N

protected int N

slotDuration

protected double slotDuration

testName

protected java.lang.String testName

realRate

protected double realRate

flowsFile

public java.io.File[] flowsFile

tM

protected java.util.TreeMap[] tM
Constructor Detail

AggregateMGInfFlowGeneration

public AggregateMGInfFlowGeneration(MGInfModel[] models,
                                    VideoCodec[] codecs,
                                    int[] weights,
                                    int[] flowsDuration,
                                    int[] startingTime,
                                    short[] units,
                                    java.lang.String fileName,
                                    boolean graphic)
                             throws java.io.IOException
You could specify everything you want

Parameters:
models - a table of MGInfModel => length : nbDifferentFlow
codecs - a table of VideoCodec => length : nbDifferentFlow
weights - a table of int => length : nbDifferentFlow
flowsDuration - a table of int => length : nbDifferentFlow
startingTime - a table of int => length : flowsNumber
units - a table of short => length : nbDifferentFlow
fileName -
graphic -
Throws:
java.io.IOException

AggregateMGInfFlowGeneration

public AggregateMGInfFlowGeneration(VideoDefinition[] vds,
                                    int[] weights,
                                    int[] startingTime,
                                    short[] units,
                                    java.lang.String fileName,
                                    boolean graphic)
                             throws java.io.IOException
Defined to used VideoDefinition like JurassicParkLow,...

Parameters:
vds -
weights - a table of int => length : nbDifferentFlow
startingTime - a table of int => length : flowsNumber
units - a table of short => length : nbDifferentFlow
fileName -
graphic -
Throws:
java.io.IOException
Method Detail

getFlowsNumber

public int getFlowsNumber()
Mehod getFlowsNumber : To compute the number of sources => nb = w1 + w2 + ... +wn

Returns:
the number of all sources: independent or not!!!

initializedParameters

public void initializedParameters()
                           throws java.io.IOException
This permit to initialized some parameters!!!

Throws:
java.io.IOException

setSlotsNumber

public void setSlotsNumber()
Method setSlotsNumber : To set the number of slots of each source type


setSlotsDuration

public void setSlotsDuration()
Method setSlotsDuration : set the duration of a slot for each source type


setNewSlotNumber

public void setNewSlotNumber()
Method setNewSlotNumber : To set the number of slots for the aggregated flow => N


createSingleFlowGenerator

public MGInfGeneration[] createSingleFlowGenerator()
                                            throws java.io.IOException
Method createSingleFlowGenerator : To create MGInfGeneration object from model,flowsDuration,codecs... We could use MGInfGeneration.dataPerSlotDistributionTransformation, MGInfGeneration.dataPerSlotDistributionComputation methods

Returns:
MGInfGeneration[] : as many MGInfGeneration object as nbDifferentFlow
Throws:
java.io.IOException

simulationDurationComputation

public int simulationDurationComputation()
Method simulationDurationComputation : To compute the duration of the aggregated flow according to "starting time" scenario

Returns:
the simultation duration in ms

dataPerSlotPerFlowType

public int[][] dataPerSlotPerFlowType()
                               throws java.io.IOException
Method dataPerSlotPerFlowType : This method permit to compute data per slot distribution for one type of source After we transform the result according to unit and number of source of this type => ex: if unit: kiloBytes -> Bytes and if there is 5 sources of this type data[i] = data[i]*5

Returns:
a new time slots vector which represents the amount of data which has to be generated for this type of souce (i.e this flow)
size : [ nbDifferentFlow ] x [ slotsNumberI ]
Throws:
java.io.IOException

slotDurationStandardization

protected int[][] slotDurationStandardization()
                                       throws java.io.IOException
Transforms a flowi type definition([slot durationi, slot numberi]) in order to obtain a flow representation as follow: ([ reference slot duration, new slot numberi])

Returns:
an int[][] with size : [ nbDifferentFlow ] x [ newSlotsNumberI ]
Throws:
java.io.IOException

slotNumberStandardization

protected int[][] slotNumberStandardization()
                                     throws java.io.IOException
Transforms a source i definition([ reference slot duration, new slot numberi]) in order to obtain a flow representation as follow:
([ reference slot duration, reference slot number])

Returns:
an int[][] with size : size : [ flowsNumber ] x [ newSlotNumber ]
Throws:
java.io.IOException

dataPerSlotDistribution

public int[] dataPerSlotDistribution()
                              throws java.io.IOException
Sums all data amount of sources slot per slot

Returns:
an array of int : size N
java.io.IOException

getNewSlotDurationReference

protected int getNewSlotDurationReference()
Works a slot duration of "reference" out : this value corresponds to mcm of slotsDuration[i]

Returns:
a slot "practical" slot duration!!!! in ms!!!

transformStartingTimeInSlotsNumber

protected int[] transformStartingTimeInSlotsNumber()
This method convert a table of starting time in ms in a table of value in number of slots If slot duration = 10ms, 20 ms corresponds to 2 slots for example Here: startingTime it's a table which contains starting time of each source in ms

Returns:
a table of int which corresponds to startingTime in slots

transformStartingTimeInSlotsNumber

protected int[] transformStartingTimeInSlotsNumber(double slotDurationReference)
This method convert a table of starting time in: ms in a table of value in: number of slots If slot duration = 10ms, 20 ms corresponds to 2 slots for example

Parameters:
slotDurationReference - it's given in seconds
Returns:
a table of int which corresponds to startingTime in slots

getFlowsPacketSize

public int[] getFlowsPacketSize()

aggregatedScenarioGeneration

public void aggregatedScenarioGeneration()
                                  throws java.io.IOException
To generate an aggregated scenario from an AggregateMGInfFlowGeneration object And a scenario file per flow type => + nbDifferentFlow scenarii

Throws:
java.io.IOException

aggregatedScenarioGeneration

public void aggregatedScenarioGeneration(java.lang.String serverName,
                                         int serverPort)
                                  throws java.io.IOException
To generate an aggregated scenario with statistics informations from an AggregateMGInfFlowGeneration object And an informative scenario file per flow type => + nbDifferentFlow scenarii

Parameters:
serverPort - to specify on which port it will be played
Throws:
java.io.IOException

scenarioGeneration

public void scenarioGeneration()
                        throws java.io.IOException
Create a "playable" scenario file of the aggregated flow

Specified by:
scenarioGeneration in class GenericGeneration
java.io.IOException
See Also:
GenericGeneration.scenarioGeneration()

scenarioGeneration

public void scenarioGeneration(java.lang.String serverName,
                               int portNumber)
                        throws java.io.IOException
Create an "informative" scenario file of the aggregated flow Return a file formated as follow:
date : serverName
Requested documents : reqDoc
Videos aggregation Test Duration : tpsSimul mn Port Number : serverPort
date: t + testTime s, IA : interpacketIime : 0.000000 s

Specified by:
scenarioGeneration in class GenericGeneration
Parameters:
serverName - gives the server name
java.io.IOException
See Also:
GenericGeneration.scenarioGeneration()

flowScenariiGeneration

public double flowScenariiGeneration()
                              throws java.io.IOException
java.io.IOException

flowScenariiGeneration

public double flowScenariiGeneration(java.lang.String serverName,
                                     int serverPort)
                              throws java.io.IOException
Returns theoritical throughput of the aggregated flow => =sum( w1*throughputi) where i =1...ndDifferentFlow
Create nbDifferentFlow scenario files

Parameters:
serverName -
serverPort -
Returns:
Throws:
java.io.IOException

scenarioGenericGeneration

protected double scenarioGenericGeneration(boolean playable,
                                           java.lang.String serverName,
                                           int serverPort)
                                    throws java.io.IOException
Description copied from class: GenericGeneration
Creates either a playable scenario file or an informative one.

Specified by:
scenarioGenericGeneration in class GenericGeneration
Parameters:
playable - if it has to be a playable scenario or not
serverName - server name
serverPort - serverPort
Returns:
average throughput in Bytes/s
Throws:
java.io.IOException

sourceTypeChoice

public int sourceTypeChoice()
To determine which source type send packets at one moment We define this method because flows have different characteristics notably packet size

Returns:
int : a sourceType number ( between 1 and flowsNumber(=> number of different sources) )

getDocumentNames

public java.lang.String getDocumentNames()
Returns a String which discribes the different flows as: model name or document name(if it exists) (source number)

Returns:
a string = testName

getTheoriticalAggregatedFlowRate

public double getTheoriticalAggregatedFlowRate()
                                        throws java.io.IOException
Returns throughput of aggregatedFlow in kb/s

Returns:
a double : this value is tranform to obtain a throughput in kb/s
java.io.IOException

getTheoriticalTransmittedDataAmount

public double getTheoriticalTransmittedDataAmount()
                                           throws java.io.IOException
Returns theoritical transmitted data amount during the generation phase in MB

Returns:
a double : this value is tranform to obtain an amount in MB
java.io.IOException

getTheoriticalTransmittedDataAmountBis

public int getTheoriticalTransmittedDataAmountBis()
                                           throws java.io.IOException
Returns theoritical transmitted data amount during the generation phase (in MBytes)

Returns:
a data amount in MBytes
Throws:
java.io.IOException

getTheoriticalTransmittedDataAmountTest

public int getTheoriticalTransmittedDataAmountTest(int[] slot)
                                            throws java.io.IOException
java.io.IOException

main

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

java.io.IOException