Package fr.ifremer.isisfish.datastore
Class ResultStorageCSV
java.lang.Object
fr.ifremer.isisfish.datastore.ResultStorageAbstract
fr.ifremer.isisfish.datastore.ResultStorageCSV
- All Implemented Interfaces:
ResultStorage
,SimulationListener
,SimulationResultGetter
,SimulationResultListener
Ecrit les resultats dans des fichiers au format pseudo csv compresse (gz)
Seules les valeurs differentes de 0 sont ecrites dans le fichier.
Il est possible de modifier via la configuration:
- le nombre de TimeStep en cache
- de definir le nombre de TimeStep a conserver sur disque
Format d'une matrice:
# commentaire [nom] [nom dimension1]:[semantique1];[semantique2];... [nom dimension2]:[semantique1];[semantique2];... ... [ligne blanche] [coordonnee1];[coordonnee2];...;[valeur] [coordonnee1];[coordonnee2];...;[valeur] [coordonnee1];[coordonnee2];...;[valeur] ...Exemple
MaMatrice Mois:Janvier;Fevrier;Mars Ville:Nantes;Paris;Nice 1;1;2;13.5 0;2;1;4.2
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin
-
Field Summary
Modifier and TypeFieldDescriptionprotected long
le nombre d'octet ecris sur le disqueprotected int
number of step in cacheprotected MatrixCSVHelper
protected int
le plus vieux pas de temps demande par rapport au pas de temps courant lu sur le disqueprotected int
nombre total de resultatprotected int
le nombre de resultat demandeprotected int
nombre de resultat reellement stocke sur disqueprotected int
le nombre de resultat lu dans le cacheprotected int
le nombre de resultat lu sur le disqueprotected TimeStep
Le pas de temps a partir duquel il faut sauver les resultats sur disqueprotected int
number of step result to store on disk.Fields inherited from class fr.ifremer.isisfish.datastore.ResultStorageAbstract
decorator, enabledResult, simulation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFileExist
(File f) void
delete()
Delete all result for this result storage.protected boolean
Method used to know if file result exist.long
getCacheForStep
(TimeStep step) protected File
donne le repertoire de stockage des resultatsgetInfo()
Return some information on result storage.protected MatrixCSVHelper
protected File
getMatrixDirectory
(String name) Donne le repertoire de stockage pour un certain type de resultat matricielprotected File
getMatrixFile
(TimeStep step, String name) return list of all result name availableprotected TimeStep
getTimeStep
(String file) Extract and create TimeStep from file name.protected boolean
isDiskResult
(TimeStep step) Indique s'il faut sauver sur disque les resultatsprotected org.nuiton.math.matrix.MatrixND
readMatrix
(String file) protected org.nuiton.math.matrix.MatrixND
readResult
(TimeStep step, String name) Return one result for step and name.protected void
writeActiveRule
(TimeStep step, String name, String params) Write active ruleprotected void
writeResult
(TimeStep step, String name, org.nuiton.math.matrix.MatrixND mat) write resultMethods inherited from class fr.ifremer.isisfish.datastore.ResultStorageAbstract
addActiveRule, addResult, addResult, addResult, addResult, addResult, addResult, addResult, addResult, addResult, afterSimulation, beforeSimulation, close, decorate, doAddResult, getLastStep, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getMatrixFactory, getProvider, isEnabled, stepChange, undecorate, undecorate, undecorate
-
Field Details
-
storeOnDiskStep
protected int storeOnDiskStepnumber of step result to store on disk. 0 for none, negative for all result -
cacheStep
protected int cacheStepnumber of step in cache -
startDiskStep
Le pas de temps a partir duquel il faut sauver les resultats sur disque -
numberOfResult
protected int numberOfResultnombre total de resultat -
numberOfResultOnDisk
protected int numberOfResultOnDisknombre de resultat reellement stocke sur disque -
numberOfResultAsked
protected int numberOfResultAskedle nombre de resultat demande -
numberOfResultReadInCache
protected int numberOfResultReadInCachele nombre de resultat lu dans le cache -
numberOfResultReadOnDisk
protected int numberOfResultReadOnDiskle nombre de resultat lu sur le disque -
bytesWritten
protected long bytesWrittenle nombre d'octet ecris sur le disque -
maxGapWithCurrentStepReadOnDisk
protected int maxGapWithCurrentStepReadOnDiskle plus vieux pas de temps demande par rapport au pas de temps courant lu sur le disque -
matrixCSVHelper
-
fileExistCache
-
-
Constructor Details
-
ResultStorageCSV
-
-
Method Details
-
getMatrixCSVHelper
-
getInfo
Description copied from class:ResultStorageAbstract
Return some information on result storage. Information depend on result storage type- Specified by:
getInfo
in interfaceResultStorage
- Overrides:
getInfo
in classResultStorageAbstract
- Returns:
-
getDirectory
donne le repertoire de stockage des resultats- Returns:
-
getMatrixDirectory
Donne le repertoire de stockage pour un certain type de resultat matriciel- Parameters:
name
-- Returns:
-
getMatrixFile
-
getFileExistCache
-
fileExist
Method used to know if file result exist. Usage of File.exists take to long time during simulation- Parameters:
f
-- Returns:
-
addFileExist
-
readMatrix
- Throws:
IOException
-
getTimeStep
Extract and create TimeStep from file name. If file name doesn't contains TimeStep null is returned- Parameters:
file
-- Returns:
-
delete
public void delete()Description copied from interface:ResultStorage
Delete all result for this result storage. In case of sensitivity analysis, after export, result are no longer needed and can be deleted to save disk space.- Specified by:
delete
in interfaceResultStorage
- Overrides:
delete
in classResultStorageAbstract
-
readResult
Description copied from class:ResultStorageAbstract
Return one result for step and name. Matrix returned must be undecorated (semantics must be string representation of object)- Specified by:
readResult
in classResultStorageAbstract
- Returns:
-
isDiskResult
Indique s'il faut sauver sur disque les resultats- Parameters:
step
-- Returns:
-
getCacheForStep
-
writeResult
Description copied from class:ResultStorageAbstract
write result- Specified by:
writeResult
in classResultStorageAbstract
-
writeActiveRule
Description copied from class:ResultStorageAbstract
Write active rule- Specified by:
writeActiveRule
in classResultStorageAbstract
-
getResultName
Description copied from class:ResultStorageAbstract
return list of all result name available- Specified by:
getResultName
in interfaceResultStorage
- Specified by:
getResultName
in classResultStorageAbstract
-
getBytesWritten
public long getBytesWritten()
-