CityScope / CS_Proxymix

ABM framework to study spatial configuration and human behaviour at the building scale
10 stars 7 forks source link

Syntax simplification for multi simulation #180

Closed agrignard closed 3 years ago

agrignard commented 3 years ago

As we are in the calibration of the model and in the real utilisation of it, i have many different simualtion to instantiate and now the syntax is really not flexible.

  1. First Question

What I have to do now is this I have a parent experimen Coronizer

experiment Coronaizer type:gui autorun:false{
parameter 'title:' var: title category: 'Initialization' <- "Reference";
    parameter 'fileName:' var: useCase category: 'Initialization' <- "MediaLab" among: ["UDG/CUCS/Campus","UDG/CUSUR","UDG/CUCEA","UDG/CUAAD","UDG/CUT/campus","UDG/CUT/lab","UDG/CUT/room104","UDG/CUCS/Level 2","UDG/CUCS/Ground","UDG/CUCS_Campus","UDG/CUCS/Level 1","Factory", "MediaLab","CityScience","Learning_Center","ENSAL","SanSebastian"];
    parameter "Mask Ratio:" category: "Policy" var: maskRatio min: 0.0 max: 1.0 step:0.1 <-0.0;
    parameter "Density Scenario" var: density_scenario category:'Policy'  <- "data" among: ["data", "distance", "num_people_building", "num_people_room"];
    parameter 'distance people:' var: distance_people category:'Policy' min:0.0 max:5.0#m <- 2.0#m;
    parameter 'ventilationType:' var: ventilationType category: 'Initialization' <- "Natural";
    parameter 'timeSpent:' var: timeSpent category: 'Initialization' <- 2.0 #h;
    parameter "Agenda Scenario:" category: 'Initialization' var: agenda_scenario  <-"simple";
...
}

Ideally I don't need this variable to be parameter but it's the only syntax that works because if I do this

experiment Coronaizer type:gui autorun:false{

    action _init_ {
        title <- "Reference";
        useCase <- "MediaLab"; 
        maskRatio <-0.0;
        density_scenario <- "data";
        distance_people <- 2.0#m;
        ventilationType <- "Natural";
        timeSpent <- 2.0 #h;
        agenda_scenario  <-"simple";

        initial_nb_infected <-10;
        queueing  <-false;
        peopleSize  <-0.3#m;
        step_arrival <- 1#s;
        arrival_time_interval <- 3 #mn;
    }
}

The simualtion doesn't work.


  1. Second question I"'d like to simply be able to create a simultion that would take all the parameter by defaut and being able to change jsut one for instance doing this
experiment Episode1_Mask_Initial_Layout type: gui parent: Coronaizer{
    //Scenario 1
    parameter 'title:' var: title category: 'Initialization' <- "No intervention";
    //Scenario 2
    init
    {   
        create simulation with:[maskRatio:1.0];
    }
}

but for now it doesnt work and I have to respecif all the parameter like this, which is useless and to verbose and hard to automatize

create simulation with: [title::"Social Distance",useCase::"MediaLab",
        ventilationType::"Natural",
        timeSpent::1.0#h,density_scenario::'distance',distance_people::2.0#m,maskRatio::0.0,queueing::false, peopleSize::0.3#m , agenda_scenario::"simple",
        arrival_time_interval:: 3#mn, step_arrival::1#s];
agrignard commented 3 years ago

It's ok I found a tradeoff doing this for now

experiment Episode1 type: gui parent: Coronaizer{
    string usecase<-"UDG/CUAAD";// 1."UDG/CUCS/Level 2" 2."UDG/CUT/lab" 3."UDG/CUAAD" 4. "UDG/CUCEA" 5."UDG/CUSUR"
    string scenario<-"simple";
    float timespent<-2.0#h;

    parameter 'fileName:' var: useCase category: 'Initialization' <- usecase;
    init
    {   
        create simulation with: [title::"Mask", maskRatio::1.0,density_scenario::'data',distance_people::2.0#m, ventilationType::"Natural",
        useCase::usecase,agenda_scenario::scenario,timeSpent::timespent];