Commit b6811353 authored by Romain Reuillon's avatar Romain Reuillon

[Plugin] enh: rename replication to sample

parent f4871af1
......@@ -40,7 +40,7 @@ In case you want to explore a stochastic model with a GA you can do:
// OpenMOLE provide a seed for your stochastic model to use (it is optional)
// 20% of the evaluations are used for replicating existing solutions
// 100 replication are stored at max for each individual
stochastic = Stochastic(seed = seed, reevaluate = 0.2, replications = 100),
stochastic = Stochastic(seed = seed, reevaluate = 0.2, sample = 100),
evaluation = model,
termination = 100
)""", header = model)
......@@ -111,10 +111,10 @@ By doing so, we let the multi-objective optimization algorithm handle the compro
This method adds only two new parameters:
@ol{
@li{@hl.code("""reevaluate"""), the probability of resampling an individual at each generation}
@li{@hl.code("""replications"""), the maximum number of evaluation values for an individual, to limit the memory used to store an individual.}
@li{@hl.code("""sample"""), the maximum number of evaluation values for an individual, to limit the memory used to store an individual.}
}
See the line @hl.code("""stochastic = Stochastic(seed = seed, reevaluate = 0.2, replications = 100)""") in the example.
See the line @hl.code("""stochastic = Stochastic(seed = seed, reevaluate = 0.2, sample = 100)""") in the example.
@br@br
......
......@@ -139,7 +139,7 @@ val model =
Replication(
evaluation = model,
seed = seed,
replications = 100,
sample = 100,
aggregation = Seq(pi aggregate average as piAvg, pi aggregate median as piMed)
) hook display hook (workDirectory / "result.json", format = JSONOutputFormat())
......
......@@ -381,6 +381,6 @@ The hook stores the file @code{g} in your @b{Workspace}, and displays the @code{
Replication(
evaluation = task1 -- (rTask hook h1),
seed = seed,
replications = 100
sample = 100
)""")
......@@ -117,7 +117,7 @@ Here is an example :
),
termination = 200000,
parallelism = 500,
stochastic = Stochastic(seed = seed, replications = 100),
stochastic = Stochastic(seed = seed, sample = 100),
distribution = Island(10 minutes)
) hook(workDirectory / "path/to/a/directory")
""", header = "val modelTask = EmptyTask()", name = "Profile")
......
......@@ -148,7 +148,7 @@ val myModel =
Replication(
evaluation = myModel,
seed = mySeed,
replications = 100
sample = 100
)
""", name="example of replication")
......@@ -159,7 +159,7 @@ The arguments for @code{Replication} are the following:
@ul
@li{@code{evaluation} is the task (or a composition of tasks) that uses your inputs, typically your model task and a hook.}
@li{@code{seed} is the prototype for the seed, which will be sampled with an uniform distribution in its domain (it must ba a Val[Int] or a Val[Long]). This prototype will be provided as an input to the model.}
@li{@code{replications} (Int) is the number of replications.}
@li{@code{sample} (Int) is the number of replications.}
@li{@code{distributionSeed} (@i{optional}, Long) is an optional seed to be given to he uniform distribution of the seed ("meta-seed"). Providing this value will fix the pseudo-random sequence generated for the prototype @code{seed}.}
@li{@code{aggregation} (@i{optional}) is an aggregation task to be performed on the outputs of your evaluation task.}
......@@ -198,7 +198,7 @@ val myModel =
Replication(
evaluation = myModel,
seed = mySeed,
replications = 100
sample = 100
) hook(
output = display,
values = Seq(i),
......
......@@ -73,7 +73,7 @@ val antsTask = NetLogo6Task(workDirectory / "ants.nlogo", launch, embedWorkspace
val replications = Replication(
evaluation = antsTask, // the model to run
seed = seed, // the seed variable
replications = 100 // the number of runs
sample = 100 // the number of runs
)
// Run the task
......@@ -143,7 +143,7 @@ val antsTask = NetLogo6Task(workDirectory / "ants.nlogo", launch, embedWorkspace
val replications = Replication(
evaluation = antsTask, // the model to run
seed = seed, // the seed variable
replications = 100 // the number of runs
sample = 100 // the number of runs
)
// Define the parameter sampling task
......
......@@ -59,7 +59,7 @@ package object directsampling {
def Replication[T: Distribution](
evaluation: DSL,
seed: Val[T],
replications: Int,
sample: Int,
distributionSeed: OptionalArgument[Long] = None,
aggregation: Seq[Aggregation] = Seq.empty,
wrap: Boolean = false,
......@@ -67,7 +67,7 @@ package object directsampling {
) = {
implicit def defScope = scope
val sampling = seed in (TakeDomain(UniformDistribution[T](distributionSeed), replications))
val sampling = seed in (TakeDomain(UniformDistribution[T](distributionSeed), sample))
val exploration = ExplorationTask(sampling)
val aggregateTask: OptionalArgument[DSL] =
......
......@@ -251,7 +251,7 @@ object NSGA2 {
val noisyObjectives = objective.map(o Objective.toNoisy(o))
val integration: WorkflowIntegration.StochasticGA[_] = WorkflowIntegration.StochasticGA(
StochasticParams(mu, operatorExploration, genome, noisyObjectives, stochasticValue.replications, stochasticValue.reevaluate, reject.option),
StochasticParams(mu, operatorExploration, genome, noisyObjectives, stochasticValue.sample, stochasticValue.reevaluate, reject.option),
genome,
noisyObjectives,
stochasticValue
......
......@@ -443,7 +443,7 @@ object NichedNSGA2 {
operatorExploration = operatorExploration,
genome = genome,
objectives = noisyObjectives,
historySize = stochasticValue.replications,
historySize = stochasticValue.sample,
cloneProbability = stochasticValue.reevaluate,
reject = reject.option),
genome,
......
......@@ -315,7 +315,7 @@ object OSE {
objectives = noisyObjectives,
limit = FitnessPattern.toLimit(objective),
operatorExploration = operatorExploration,
historySize = stochasticValue.replications,
historySize = stochasticValue.sample,
cloneProbability = stochasticValue.reevaluate,
reject = reject.option),
fg,
......
......@@ -445,7 +445,7 @@ object PSE {
pattern = mgo.evolution.niche.irregularGrid(objective.map(_.scale).toVector),
genome = genome,
objectives = noisyObjectives,
historySize = stochasticValue.replications,
historySize = stochasticValue.sample,
cloneProbability = stochasticValue.reevaluate,
operatorExploration = operatorExploration,
reject = reject.option),
......
......@@ -28,9 +28,9 @@ import cats.implicits._
import org.openmole.core.exception.UserBadDataError
case class Stochastic(
seed: SeedVariable = SeedVariable.empty,
replications: Int = 100,
reevaluate: Double = 0.2
seed: SeedVariable = SeedVariable.empty,
sample: Int = 100,
reevaluate: Double = 0.2
)
object WorkflowIntegration {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment