This wf works (in the latest 5.0):

val i = Val[Double]
val seed = Val[Int]
val res = Val[Double]

val exploration = ExplorationTask(i in (0.0 to 100.0 by 1.0))

val model =
  ScalaTask("val res = i * 2") set (
    inputs += i,
    outputs += (i, res)
  )

val agg = Capsule(EmptyTask(), strainer = true)
val replicateModel = Replicate(model, seed in (UniformDistribution[Int]() take 2), agg)

val ex = exploration -< replicateModel + (agg hook ToStringHook(i.toArray, res.toArray)) start

Output is:
{i=[100.0, 100.0], res=[200.0, 200.0]}
{i=[99.0, 99.0], res=[198.0, 198.0]}
{i=[98.0, 98.0], res=[196.0, 196.0]}
{i=[97.0, 97.0], res=[194.0, 194.0]}
{i=[96.0, 96.0], res=[192.0, 192.0]}
{i=[95.0, 95.0], res=[190.0, 190.0]}
{i=[94.0, 94.0], res=[188.0, 188.0]}
...


Le 20/06/2015 19:43, Romain Reuillon a écrit :
Do you mean that you want to have un number of experiment in you csv file?

I think what you can achieve is having something like:
experiment,replication
0,0
0,1
1,0
...

by using zipWithIndex in you samplings.


Le 20/06/2015 19:35, reyman a écrit :
Hi,

I'm trying to launch some test on ants.nlogo, and i'm searching a way to get the number of experience i into my csvfile.

I try to do a *hook saveHook* on replicateModel to get the *i experience number*, but it doesn't work. Can i make a datachannel to pass directly this *i* *experience number *to *statisticCapsule* ?

Best !
Sr.

Extract of the corresponding wf :

--
val statistic =
  StatisticTask() set (
    statistics += (food1, medNumberFood1, median),
    statistics += (food2, medNumberFood2, median),
    statistics += (food3, medNumberFood3, median)
  )

val exploration = ExplorationTask(i in (0.0 to 5.0 by 1.0))
val statisticCapsule = Capsule(statistic)
val env = LocalEnvironment(10)
val seedFactor = seed in (UniformDistribution[Int]() take 2)
val replicateModel = Replicate(modelCapsule, seedFactor, statisticCapsule)

// Define the hooks to collect the results
val displayOutputs = ToStringHook(i, seed, food1, food2, food3)
val displayMedians = ToStringHook(medNumberFood1, medNumberFood2, medNumberFood3) *val saveHook = AppendToCSVFileHook(resPath + "replication.csv", i, gPopulation, gDiffusionRate, gEvaporationRate, medNumberFood1, medNumberFood2,medNumberFood3)
*
// Execute the workflow
val ex = exploration -< (replicateModel + (modelCapsule on env hook displayOutputs) + (statisticCapsule hook displayMedians) ) start




--
<http://stackoverflow.com/users/385881/reyman64>


_______________________________________________
OpenMOLE-users mailing list
[email protected]
http://fedex.iscpif.fr/mailman/listinfo/openmole-users



_______________________________________________
OpenMOLE-users mailing list
[email protected]
http://fedex.iscpif.fr/mailman/listinfo/openmole-users

Attachment: smime.p7s
Description: Signature cryptographique S/MIME

_______________________________________________
OpenMOLE-users mailing list
[email protected]
http://fedex.iscpif.fr/mailman/listinfo/openmole-users

Reply via email to