Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / test / CQPBenchmark.groovy @ 626

History | View | Annotate | Download (13.7 kB)

1 479 mdecorde
package org.txm.test
2 479 mdecorde
3 479 mdecorde
4 479 mdecorde
/**
5 479 mdecorde
 * Main.
6 479 mdecorde
 *
7 479 mdecorde
 * @param args the args
8 479 mdecorde
 */
9 479 mdecorde
// Copyright © 2010-2013 ENS de Lyon.
10 479 mdecorde
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
11 479 mdecorde
// Lyon 2, University of Franche-Comté, University of Nice
12 479 mdecorde
// Sophia Antipolis, University of Paris 3.
13 479 mdecorde
//
14 479 mdecorde
// The TXM platform is free software: you can redistribute it
15 479 mdecorde
// and/or modify it under the terms of the GNU General Public
16 479 mdecorde
// License as published by the Free Software Foundation,
17 479 mdecorde
// either version 2 of the License, or (at your option) any
18 479 mdecorde
// later version.
19 479 mdecorde
//
20 479 mdecorde
// The TXM platform is distributed in the hope that it will be
21 479 mdecorde
// useful, but WITHOUT ANY WARRANTY; without even the implied
22 479 mdecorde
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
23 479 mdecorde
// PURPOSE. See the GNU General Public License for more
24 479 mdecorde
// details.
25 479 mdecorde
//
26 479 mdecorde
// You should have received a copy of the GNU General
27 479 mdecorde
// Public License along with the TXM platform. If not, see
28 479 mdecorde
// http://www.gnu.org/licenses.
29 321 mdecorde
//
30 321 mdecorde
//
31 321 mdecorde
//
32 479 mdecorde
// $LastChangedDate: 2011-11-25 11:30:11 +0100 (ven., 25 nov. 2011) $
33 479 mdecorde
// $LastChangedRevision: 2069 $
34 479 mdecorde
// $LastChangedBy: mdecorde $
35 321 mdecorde
//
36 479 mdecorde
37 479 mdecorde
38 479 mdecorde
import java.util.ArrayList;
39 479 mdecorde
40 479 mdecorde
import org.txm.utils.DeleteDir;
41 479 mdecorde
import org.txm.*;
42 479 mdecorde
import org.txm.lexicaltable.core.functions.LexicalTable
43 479 mdecorde
import org.txm.objects.Base;
44 479 mdecorde
import org.txm.ca.core.functions.CA
45 528 sjacqu01
import org.txm.cah.core.functions.AHC
46 479 mdecorde
import org.txm.concordance.core.functions.Concordance
47 479 mdecorde
import org.txm.cooccurrence.core.functions.Cooccurrence
48 479 mdecorde
import org.txm.functions.*;
49 479 mdecorde
import org.txm.functions.diagnostic.*;
50 479 mdecorde
import org.txm.functions.ca.*;
51 479 mdecorde
import org.txm.functions.index.*;
52 479 mdecorde
import org.txm.functions.specificities.*;
53 479 mdecorde
import org.txm.functions.concordances.*;
54 479 mdecorde
import org.txm.functions.concordances.comparators.*;
55 626 sjacqu01
import org.txm.referencer.core.functions.Referencer;
56 479 mdecorde
import org.txm.searchengine.cqp.ReferencePattern
57 479 mdecorde
import org.txm.searchengine.cqp.corpus.*;
58 479 mdecorde
import org.txm.searchengine.cqp.corpus.query.*;
59 479 mdecorde
60 479 mdecorde
61 479 mdecorde
testDir = new File(System.getProperty("user.home"), "TXM/testrelease");
62 479 mdecorde
DeleteDir.deleteDirectory testDir;
63 479 mdecorde
testDir.mkdir()
64 479 mdecorde
65 479 mdecorde
//get corpus
66 479 mdecorde
csv = [];
67 479 mdecorde
firstExecution = 0;
68 479 mdecorde
69 479 mdecorde
def process(String CORPUSNAME, String QUERY1, String QUERY2) {
70 479 mdecorde
71 479 mdecorde
        String ENCODING = "UTF-8"
72 479 mdecorde
        String COLSEPARATOR = "\t"
73 479 mdecorde
        String TXTSEPARATOR = ""
74 479 mdecorde
        int i = 0;
75 479 mdecorde
        def corpora = CorpusManager.getCorpusManager().getCorpora()
76 479 mdecorde
        MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(CORPUSNAME)
77 479 mdecorde
        //println "CORPUS: "+corpus
78 479 mdecorde
79 479 mdecorde
        Query query = new Query(QUERY1) //"\"..............*\"", "\"..........*\""
80 479 mdecorde
        Query query2 = new Query(QUERY2)
81 479 mdecorde
82 479 mdecorde
        File exporttestdir = new File(testDir, corpus.getName());
83 479 mdecorde
        File reportFile = new File(exporttestdir, "report.csv")
84 479 mdecorde
        DeleteDir.deleteDirectory exporttestdir;
85 479 mdecorde
        exporttestdir.mkdir()
86 479 mdecorde
        //println "Results are saved in dir: "+ exporttestdir
87 479 mdecorde
88 479 mdecorde
        // word properties
89 479 mdecorde
        def word_property = corpus.getProperty("word")
90 479 mdecorde
91 479 mdecorde
        // structure properties
92 479 mdecorde
        StructuralUnit text_su = corpus.getStructuralUnit("text")
93 479 mdecorde
        StructuralUnit s_su = corpus.getStructuralUnit("s")
94 479 mdecorde
        Property text_id_property = text_su.getProperty("id")
95 479 mdecorde
        ReferencePattern referencePattern = new ReferencePattern().addProperty(text_id_property)
96 479 mdecorde
97 479 mdecorde
        long time;
98 479 mdecorde
        // START START START START
99 479 mdecorde
        if (firstExecution == 0)
100 479 mdecorde
                csv << ["object", "size", "nPart", "command", "query", "query freq", "$CORPUSNAME $QUERY1 $QUERY2 mode "+Toolbox.getParam(Toolbox.CQI_NETWORK_MODE)]
101 479 mdecorde
        else
102 479 mdecorde
                csv[i++] << "$CORPUSNAME $QUERY1 $QUERY2 mode "+Toolbox.getParam(Toolbox.CQI_NETWORK_MODE)
103 479 mdecorde
104 479 mdecorde
        // INFORMATIONS
105 479 mdecorde
        print " INFO"
106 479 mdecorde
        time = System.currentTimeMillis();
107 479 mdecorde
        Diagnostic diag = new Diagnostic(corpus, 20)
108 479 mdecorde
        diag.stepGeneralInfos();
109 479 mdecorde
        diag.stepLexicalProperties();
110 479 mdecorde
        diag.stepStructuralUnits();
111 479 mdecorde
        diag.toHTML(new File(exporttestdir, "diag"))
112 479 mdecorde
        if (firstExecution == 0)
113 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Informations", "no query", "no freq", (System.currentTimeMillis()-time)/1000]
114 479 mdecorde
        else
115 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
116 479 mdecorde
117 479 mdecorde
        // LEXICON
118 479 mdecorde
        print " LEX"
119 479 mdecorde
        time = System.currentTimeMillis();
120 479 mdecorde
        corpus.getLexicon(word_property).toTxt(new File(exporttestdir, "lexpos"), ENCODING, COLSEPARATOR, TXTSEPARATOR);
121 479 mdecorde
        if (firstExecution == 0)
122 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Lexicon", "no query", "no freq", (System.currentTimeMillis()-time)/1000]
123 479 mdecorde
        else
124 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
125 479 mdecorde
126 479 mdecorde
        // INDEX
127 479 mdecorde
        print " INDEX"
128 479 mdecorde
        time = System.currentTimeMillis();
129 479 mdecorde
        IndexSample index = new IndexSample(corpus, query, [word_property])
130 479 mdecorde
        index.toTxt(new File(exporttestdir, "indexlemmafuncj"), ENCODING, COLSEPARATOR, TXTSEPARATOR)
131 479 mdecorde
        if (firstExecution == 0)
132 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Index", query, index.getT(), (System.currentTimeMillis()-time)/1000]
133 479 mdecorde
        else
134 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
135 479 mdecorde
136 479 mdecorde
        // REFERENCER
137 479 mdecorde
        print " REF"
138 479 mdecorde
        time = System.currentTimeMillis();
139 479 mdecorde
        Referencer referencer = new Referencer(corpus, query, word_property, [text_id_property], true);
140 479 mdecorde
        referencer.getQueryMatches()
141 479 mdecorde
        referencer.getQueryindexes()
142 479 mdecorde
        referencer.groupPositionsbyId()
143 479 mdecorde
        referencer.toTxt(new File(exporttestdir, "referencer"), ENCODING)
144 479 mdecorde
        if (firstExecution == 0)
145 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Referencer", query, index.getT(), (System.currentTimeMillis()-time)/1000]
146 479 mdecorde
        else
147 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
148 479 mdecorde
149 479 mdecorde
        // CONCORDANCE
150 479 mdecorde
        print " CONC"
151 479 mdecorde
        time = System.currentTimeMillis();
152 479 mdecorde
        Concordance concordance = new Concordance(corpus, query, word_property, [word_property, word_property], referencePattern, referencePattern, 15, 15)
153 479 mdecorde
        concordance.toTxt(new File(exporttestdir,"concj"), Concordance.Format.CONCORDANCE)
154 479 mdecorde
        if (firstExecution == 0)
155 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Concordances", query, index.getT(), (System.currentTimeMillis()-time)/1000]
156 479 mdecorde
        else
157 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
158 479 mdecorde
159 479 mdecorde
        // COOCCURRENCE WORD WINDOW
160 479 mdecorde
        print " COOC"
161 479 mdecorde
        time = System.currentTimeMillis();
162 479 mdecorde
        Cooccurrence cooc = new Cooccurrence(corpus, query, [word_property], null, 21, 1, 1, 11, 2, 3, 1, false);
163 479 mdecorde
        cooc.process();
164 479 mdecorde
        cooc.toTxt(new File(exporttestdir, "cooc_wordwindow"), ENCODING)
165 479 mdecorde
        if (firstExecution == 0)
166 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Cooccurrences words", query, index.getT(), (System.currentTimeMillis()-time)/1000]
167 479 mdecorde
        else
168 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
169 479 mdecorde
170 479 mdecorde
        // COOCCURRENCE SENTENCE WINDOW
171 479 mdecorde
        print " COOC"
172 479 mdecorde
        time = System.currentTimeMillis();
173 479 mdecorde
        Cooccurrence cooc2 = new Cooccurrence(corpus, query, [word_property], s_su,2, 1, 1, 1, 2, 3,1, false);
174 479 mdecorde
        cooc2.process();
175 479 mdecorde
        cooc2.toTxt(new File(exporttestdir, "cooc_swindow"), ENCODING)
176 479 mdecorde
        if (firstExecution == 0)
177 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Cooccurrences structures", query, index.getT(), (System.currentTimeMillis()-time)/1000]
178 479 mdecorde
        else
179 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
180 479 mdecorde
181 479 mdecorde
        // INDEX
182 479 mdecorde
        print " INDEX"
183 479 mdecorde
        time = System.currentTimeMillis();
184 479 mdecorde
        index = new IndexSample(corpus, query2, [word_property])
185 479 mdecorde
        index.toTxt(new File(exporttestdir, "indexlemmafuncj"), ENCODING, COLSEPARATOR, TXTSEPARATOR)
186 479 mdecorde
        if (firstExecution == 0)
187 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Index", query2, index.getT(), (System.currentTimeMillis()-time)/1000]
188 479 mdecorde
        else
189 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
190 479 mdecorde
191 479 mdecorde
        // REFERENCER
192 479 mdecorde
        print " REF"
193 479 mdecorde
        time = System.currentTimeMillis();
194 479 mdecorde
        referencer = new Referencer(corpus, query2, word_property, [text_id_property], true);
195 479 mdecorde
        referencer.getQueryMatches()
196 479 mdecorde
        referencer.getQueryindexes()
197 479 mdecorde
        referencer.groupPositionsbyId()
198 479 mdecorde
        referencer.toTxt(new File(exporttestdir, "referencer"), ENCODING)
199 479 mdecorde
        if (firstExecution == 0)
200 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Referencer", query, index.getT(), (System.currentTimeMillis()-time)/1000]
201 479 mdecorde
        else
202 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
203 479 mdecorde
204 479 mdecorde
        // CONCORDANCE
205 479 mdecorde
        print " CONC"
206 479 mdecorde
        time = System.currentTimeMillis();
207 479 mdecorde
        concordance = new Concordance(corpus, query2, word_property, [word_property, word_property], referencePattern, referencePattern, 15, 15)
208 479 mdecorde
        concordance.toTxt(new File(exporttestdir,"concj"), Concordance.Format.CONCORDANCE)
209 479 mdecorde
        if (firstExecution == 0)
210 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Concordances", query, index.getT(), (System.currentTimeMillis()-time)/1000]
211 479 mdecorde
        else
212 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
213 479 mdecorde
214 479 mdecorde
        // COOCCURRENCE WORD WINDOW
215 479 mdecorde
        print " COOC"
216 479 mdecorde
        time = System.currentTimeMillis();
217 479 mdecorde
        cooc = new Cooccurrence(corpus, query2, [word_property], null, 21, 1, 1, 11, 2, 3, 1, false);
218 479 mdecorde
        cooc.process();
219 479 mdecorde
        cooc.toTxt(new File(exporttestdir, "cooc_wordwindow"), ENCODING)
220 479 mdecorde
        if (firstExecution == 0)
221 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Cooccurrences words", query, index.getT(), (System.currentTimeMillis()-time)/1000]
222 479 mdecorde
        else
223 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
224 479 mdecorde
225 479 mdecorde
        // COOCCURRENCE SENTENCE WINDOW
226 479 mdecorde
        print " COOC"
227 479 mdecorde
        time = System.currentTimeMillis();
228 479 mdecorde
        cooc2 = new Cooccurrence(corpus, query2, [word_property], s_su,2, 1, 1, 1, 2, 3,1, false);
229 479 mdecorde
        cooc2.process();
230 479 mdecorde
        cooc2.toTxt(new File(exporttestdir, "cooc_swindow"), ENCODING)
231 479 mdecorde
        if (firstExecution == 0)
232 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Cooccurrences structures", query, index.getT(), (System.currentTimeMillis()-time)/1000]
233 479 mdecorde
        else
234 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
235 479 mdecorde
236 479 mdecorde
        // SUBCORPORA
237 479 mdecorde
        print " SUBCORPUS"
238 479 mdecorde
        time = System.currentTimeMillis();
239 479 mdecorde
        Corpus DGcorpus = corpus.createSubcorpus(text_su, text_id_property, "01_DeGaulle", "dgsubcorpus")
240 479 mdecorde
        if (firstExecution == 0)
241 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Subcorpus", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
242 479 mdecorde
        else
243 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
244 479 mdecorde
245 479 mdecorde
        // PARTITIONS
246 479 mdecorde
        print " PARTITIONS"
247 479 mdecorde
        time = System.currentTimeMillis();
248 479 mdecorde
        Partition discours_types = corpus.createPartition(text_su, text_id_property)
249 479 mdecorde
        Partition discours_dates = corpus.createPartition(text_su, text_id_property)
250 479 mdecorde
        if (firstExecution == 0)
251 479 mdecorde
                csv << [corpus.getName(), corpus.getSize(), 1, "Partition 2x", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
252 479 mdecorde
        else
253 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
254 479 mdecorde
255 479 mdecorde
        // LEXICAL TABLE
256 479 mdecorde
        print " LT"
257 479 mdecorde
        time = System.currentTimeMillis();
258 479 mdecorde
        LexicalTable table = discours_types.getLexicalTable(word_property, 2);
259 479 mdecorde
        table.exportData(new File(exporttestdir, "type_LT"), COLSEPARATOR, TXTSEPARATOR);
260 479 mdecorde
        if (firstExecution == 0)
261 479 mdecorde
                csv << [discours_types.getName(), corpus.getSize(), discours_types.getNPart(), "LT part", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
262 479 mdecorde
        else
263 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
264 479 mdecorde
265 479 mdecorde
        // SPECIF SUBCORPUS
266 321 mdecorde
//        time = System.currentTimeMillis();
267 479 mdecorde
//        print " SPECIF"
268 479 mdecorde
//        SpecificitesResult specifresult2 = org.txm.functions.specificities.Specificites.specificites(DGcorpus.getParent(), DGcorpus, word_property)
269 479 mdecorde
//        specifresult2.toTxt(new File(exporttestdir,"dgsub_specifloc"), ENCODING, COLSEPARATOR, TXTSEPARATOR)
270 321 mdecorde
//        if (firstExecution == 0)
271 479 mdecorde
//                csv << [DGcorpus.getName(), corpus.getSize(), 1, "Specif sub", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
272 321 mdecorde
//        else
273 321 mdecorde
//                csv[i++] << (System.currentTimeMillis()-time)/1000
274 321 mdecorde
//
275 479 mdecorde
//        // SPECIF LEXICAL TABLE
276 479 mdecorde
//        print " SPECIF"
277 321 mdecorde
//        time = System.currentTimeMillis();
278 479 mdecorde
//        SpecificitesResult specifresult3 = org.txm.functions.specificities.Specificites.specificites(table);
279 479 mdecorde
//        specifresult3.toTxt(new File(exporttestdir,"speciftype"), ENCODING, COLSEPARATOR, TXTSEPARATOR)
280 321 mdecorde
//        if (firstExecution == 0)
281 479 mdecorde
//                csv << [table.getName(), corpus.getSize(), table.getNColumns(), "specif LT", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
282 321 mdecorde
//        else
283 321 mdecorde
//                csv[i++] << (System.currentTimeMillis()-time)/1000
284 479 mdecorde
285 479 mdecorde
        // AFC PARTITION
286 479 mdecorde
        print " AFC"
287 479 mdecorde
        time = System.currentTimeMillis();
288 479 mdecorde
        CA ca = new CA(discours_dates, word_property, 0 ,9999999)
289 479 mdecorde
        ca.stepLexicalTable();
290 479 mdecorde
        ca.stepSortTableLexical();
291 544 sjacqu01
        ca.compute()
292 479 mdecorde
        ca.toSVGFactorialMap(new File(exporttestdir,"cadates"), true, true)
293 479 mdecorde
        ca.toSVGSingularValues(new File(exporttestdir,"cadates_singularvalues"))
294 479 mdecorde
        if (firstExecution == 0)
295 479 mdecorde
                csv << [discours_dates.getName(), corpus.getSize(), discours_dates.getNPart(), "AFC part", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
296 479 mdecorde
        else
297 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
298 479 mdecorde
299 479 mdecorde
        // AFC LEXICAL TABLE
300 479 mdecorde
        print " AFC"
301 479 mdecorde
        time = System.currentTimeMillis();
302 479 mdecorde
        CA ca2 = new CA(table);
303 544 sjacqu01
        ca2.compute()
304 479 mdecorde
        ca2.toSVGFactorialMap(new File(exporttestdir,"cadates"), true, true)
305 479 mdecorde
        ca2.toSVGSingularValues(new File(exporttestdir,"cadates_singularvalues"))
306 479 mdecorde
        if (firstExecution == 0)
307 479 mdecorde
                csv << [table.getName(), corpus.getSize(), table.getNColumns(), "specif LT", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
308 479 mdecorde
        else
309 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
310 479 mdecorde
311 479 mdecorde
        // CAH
312 479 mdecorde
        print " CAH"
313 479 mdecorde
        time = System.currentTimeMillis();
314 528 sjacqu01
        AHC cah = new AHC(ca, true, AHC.getDefaultMethod(), AHC.getDefaultMetric(), 4, false)
315 479 mdecorde
        cah.stepCompute()
316 479 mdecorde
        cah.toSVG(new File(exporttestdir, "dates_cah"),RDevice.SVG);
317 479 mdecorde
        if (firstExecution == 0)
318 479 mdecorde
                csv << [discours_dates.getName(), corpus.getSize(), discours_dates.getNPart(), "CAH ca table", "no query", "no freqs", (System.currentTimeMillis()-time)/1000]
319 479 mdecorde
        else
320 479 mdecorde
                csv[i++] << (System.currentTimeMillis()-time)/1000
321 479 mdecorde
322 479 mdecorde
        firstExecution++;
323 479 mdecorde
        println ""
324 479 mdecorde
325 479 mdecorde
}
326 479 mdecorde
327 479 mdecorde
328 479 mdecorde
329 479 mdecorde
println "restarting TBX..."
330 479 mdecorde
Toolbox.setParam(Toolbox.CQI_NETWORK_MODE, "false")
331 479 mdecorde
println "MEMORY MODE: "+Toolbox.restart();
332 479 mdecorde
process("DISCOURS", "\"..............*\"", "\"..........*\"") // first time
333 479 mdecorde
println "MEMORY MODE: "+Toolbox.restart();
334 479 mdecorde
process("DISCOURS", "\"..............*\"", "\"..........*\"")
335 479 mdecorde
336 479 mdecorde
println "restarting TBX..."
337 479 mdecorde
Toolbox.setParam(Toolbox.CQI_NETWORK_MODE, "true")
338 479 mdecorde
println "NETWORK MODE: "+Toolbox.restart();
339 479 mdecorde
process("DISCOURS", "\"..............*\"", "\"..........*\"")
340 479 mdecorde
println "NETWORK MODE: "+Toolbox.restart();
341 479 mdecorde
process("DISCOURS", "\"..............*\"", "\"..........*\"")
342 479 mdecorde
343 479 mdecorde
344 479 mdecorde
345 479 mdecorde
346 479 mdecorde
// add TOTAL line
347 479 mdecorde
int[] totaux = ["","","","","","",""]
348 479 mdecorde
for (int i = 7 ; i < csv.size() ; i++) {
349 479 mdecorde
        int total = 0;
350 479 mdecorde
        for (def line : csv) {
351 479 mdecorde
                total += line[i]
352 479 mdecorde
        }
353 479 mdecorde
        totaux << total
354 479 mdecorde
}
355 479 mdecorde
csv << totaux;
356 479 mdecorde
357 479 mdecorde
// WRITE ALL RESULTS
358 479 mdecorde
for (def line : csv) {
359 479 mdecorde
        for (int i = 0 ; i < firstExecution ; i++) {
360 479 mdecorde
                def item = line[i]
361 479 mdecorde
                if (i > 0) print "\t"+item
362 479 mdecorde
                else print item
363 479 mdecorde
        }
364 479 mdecorde
        println ""
365 479 mdecorde
}