Code Monkey home page Code Monkey logo

comokit-model's Introduction


Logo

COMOKIT-Model

Fight the COVID-19 with models
Explore the project »

Contributors · Issues · GPL3 License
Fork · Fork

Table of Contents

About The Project

These models illustrate how agent-based modeling can be used to assess the impacts of various containment policies in case studies defined by their geographical boundaries. For more information, see http://comokit.org

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Installation

  1. First, download and extract the GAMA Continuous Build version (if you don't know which version to take, choose the one with JDK). If you need more information about how to install GAMA, check the installation page

  2. Second, download the model on GitHub (click here to download it automatically)

  3. Extract that ZIP file somewhere on your computer and import it on GAMA.

  4. Enjoy our model running on your computer.

Usage

Add your own dataset

Here's a 5 minutes tutorial to show you how to do :

5 minutes tutorial to create a complete case study in COMOKIT

Roadmap

See the current milestone for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is distributed under the GPL-3.0 License. See LICENSE for more information.

comokit-model's People

Contributors

alexisdrogoul avatar benoitgaudou avatar chapuisk avatar dam-philippon avatar dphilippon avatar hqnghi88 avatar imgbotapp avatar minhduc0711 avatar ndgnuh avatar ptaillandier avatar quittqick avatar roiarthurb avatar spchjken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comokit-model's Issues

The primtive or action ... cannot be resolved when using the Covid 19 kit

I downloaded the latest version for windows + JDK(1.8), then downloaded your Covid 19 kit and imported it to the platform as instructed.
seem to not able to run the models because of the following primitive missing:
'folder_exists'
'gauss_rnd'
lognormal_rnd'
'weibull_rnd'

the error texts are:

  1. The primitive or action 'folder_exists' cannot be resolved (either it is not defined or not accessible). Resource: "/CoVid19 Modeling Kit/Experiments/Abstract Experiment.gaml"

  2. The primitive or action 'gauss_rnd' cannot be resolved (either it is not defined or not accessible) Resource: /CoVid19 Modeling Kit/Model/Functions.gaml

  3. The primitive or action 'lognormal_rnd' cannot be resolved (either it is not defined or not accessible) Resource: /CoVid19 Modeling Kit/Model/Functions.gaml

  4. The primitive or action 'weibull_rnd' cannot be resolved (either it is not defined or not accessible) Resource: /CoVid19 Modeling Kit/Model/Functions.gaml

I think it might be version related as these function might be missing in older version, although i downloaded the latest one.

Tried to update and install plugins but then it does not starts any more(other have referred to the update problem already)

Things to check before the release of COMOKIT V1

Hi,

Here are all the things to check before the release of COMOKIT V1. Please

  • tick where you think it has been done,
  • edit this issue to add new requirements
  • comment to indicate that you are working on a specific task.

Build

Model

  • Verify that all the experiments are working on all the datasets shipped by default
  • Make sure that the code is properly commented
  • Make sure that the purpose of each experiment is explained (it is a bit hard, sometimes, to understand what they are meant to !) (see last commit here : 4560be9)
  • Make sure that no write or debug information are left over (2cc6aa2)
  • Verify all headers (and put http://comokit.org instead of the old address) + a mention to V1 and the date (May 2020) (077aca5)
  • Build an asset that contains GAMA + JDK + COMOKIT (with COMOKIT V1 and the template project in the Library of Models or in a specific plugin of GAMA ?) and have it available to download ? (3a0bd88, fba3d56, 16c29c4)
  • Have a more complete README.md file or description of the release, so as to not force people to go to the website to know how to run it. (b0c78e7, fb0cb74, 8436fe5, 02f0490)

Templates

  • Add 2-3 more templates (comparison between policies, for instance) to the template project
  • Document the use of the template project (in the code and README.md ?)
  • Verify the headers (see above)

Website

  • Have a functional website
  • Reuse, for the site, material from the Covid19 page and shut down this page once it is done
  • Prepare a small introductory text for V1, publish it on the website on a dedicated page (see https://comokit.org/docs/version1)
  • Have a section on it dedicated to the documentation and guidelines (see below)

Documentation & guidelines

  • Make sure that the ODD description is on par with the model
  • Publish the ODD description on the website (as a PDF and/or HTML version)
  • Make a simplified version of the ODD description to describe the model (b892ee9)
  • Write a A to Z documentation on how to use COMOKIT on a specific dataset (what to download, duplicate the template project, things to check, etc.)

COMSES & others

Social Media & others

  • Share the release of V1 on GAMA FB page using the text of the website
  • Share the release of V1 on GAMA Mailing-list, JASSS mailing-list, others ?
  • Share the release of V1 on LinkedIn (personal accounts).

Other

Repository

We need to change this before anything is actually done : CoVid19/GAMA_model/CoVid19...

What kind of path is it ???

I propose:

CoVid19 Models
---- GAMA Models
---- National Diffusion
---- Vinh Phuc Containment
---- Ben Tre Containment

Or something approaching...

Same dataset, same seed -> different results ...

I create (in COMOKIT Template Project) a new model from the template Case Studies Comparison.template without any modification.
In the datasets folder, I copy the Sample dataset from COMOKIT and paste it twice in the datasets folder of COMIKIT Template Project.

I have a model, with the same datasets, and the same seed for both simulations, so I was expecting exactly the same results in both simulations.
Nevertheless the plot shows difference...

Screenshot 2020-05-11 at 10 34 44

Display the current hour

To help people to understand what happens in the model (and the behavior of people), it will be nice to have a way to see the current hour of the day (e.g. display in the overlay the current hour; play with the light (day/night), etc.).

(I do not do it myself as I am not the best in terms of design and because the resolution of my screen is not very common.)

More realistic "positive" cases' behaviors

When an individual becomes infected and tests positive (with the observation policy on), we should turn its behaviour into something more realistic: stay confined at home, go to an hospital ? All activities should also be forbidden.

Making COMOKIT Individual species extendable

Is your feature request related to a problem? Please describe.
Currently there is no way to extends Individual to add new attributes, action and reflexes without changing the code from COMOKIT

Describe the solution you'd like
It should be possible to define an Individual subspecies to be used as it is Individual from the model. It should be possible adding a parameter of the model string main_agent <- my_own_individual with species my_own_individual parent:Individual and creating COMOKIT main agent this way: create species(main_agent.name). After that, all dynamic that call Individual species (e.g. a ask statement) should be replaced with Individual+(Individual.subspecies accumulate each.population)

Describe alternatives you've considered
The alternative I currently work on implies encapsulating Individual into another external species that will have other attributes, action and reflexes and share all necessary things with their _inner_individual. However, it double the number of agent and makes initialization not an easy task (i.e. COMOKIT creates Individual with homeplaces, agendas, friends and so on, and after that you create you own species possibly relocating them, changing agendas and so on)

Additional context
The request will be useful to make COMOKIT even easier to extende

Allow buildings to have several types

Is your feature request related to a problem? Please describe.
There is no way in the model to define building so they may host several activities within: e.g. a homeplace that is also a shop, a shopping center that also host restaurant and dentists.

Describe the solution you'd like
Turn the type attribute of building into a list of type.

Describe alternatives you've considered
Currently, I create mixing type (e.g. home_work) and connect it with several activity types in the Building type to activity type.csv parameter file

School and workplace shutdown.gaml: no infection

I run the experiment School and workplace shutdown.gaml with no closure (so set in the user_input popup, both closures to false).

So we can observe individuals moving both to schools and working places.

But, even after running the experiment several times (3 or 4 times), I cannot observe that the disease spreads in the population (basically, only the 2 initial infected people are infected all over the simulations)

School and workplace shutdown.gaml : inversion school / working place closure ?

When running the model School and workplace shutdown.gaml, I notice that the user_input window does not seem to behave as expected:

When working place closure is set to true, and school closure set to false:
Screenshot 2020-05-10 at 18 06 41

The simulation seems to show the converse behavior (as many individuals move to the working place in the bottom left of the picture)

Screenshot 2020-05-10 at 18 06 59

Ben Tre dataset cannot load after restructuring

Chosing 1 (Ben tre dataset ) cause exception
2 occurrences in 2 agents at cycle 0: Error: nil value detected
in schools[l] <- buildings_per_activity[type] as_map (each :: each.shape.area);
in schools[l] <- buildings_per_activity[type] as_map (each :: each.shape.area);
in loop l over: possible_schools.keys {
max_student_age <- max([max_student_age,max(l)]);
min_student_age <- min([min_student_age,min(l)]);
string type <- possible_schools[l];
schools[l] <- buildings_per_activity[type] as_map (each :: each.shape.area);
}
...in agents Simulation 0, Comparison0
Probably come from the fact that this dataset doesn't have "university" building type.

Use projet_path to redefine all the global variable

Up to now, all the file paths are determined from the location of the experiment that is launched.

To avoid error and give more flexibility to modeler in their definition of experiment,
we should use project_path to define path.

Mess with the management of paths

It seems that the management of paths at the simulation level creates some problems... At least experiments should have an idea of the path, even without a simulation created.

As an example, in "Realistic Lockdown Durations.gaml", the dataset is asked before any simulation is created. And this makes the model crash at the very beginning (not to mention that the function, ask_dataset_path, that asks for the dataset is declared in experiment but is using world, which is not available in experiments).

The only way I could make it work was to code, in "Abstract Experiment.gaml", the following:

	/*
	 * Gather all the sub-folder of the given dataset_folder
	 */
	list<string> gather_dataset_names(string absolute_dataset_fol) {
		write(absolute_dataset_fol);
		list<string> dirs <- folder(absolute_dataset_fol).contents  ;
		write dirs;
		dirs <- dirs where folder_exists(absolute_dataset_fol + "/" + each);
		write dirs;
		return dirs;
	}
	

	string ask_dataset_path(string relative_dataset_folder_path) {
		string question <- "Choose a dataset:";
		list<string> dirs <- gather_dataset_names(project_path + relative_dataset_folder_path);
		string ds <- user_input(question,choose("", string, dirs[0], dirs))[""];
		return project_path + relative_dataset_folder_path + "/" + ds + "/";
	}

And call it with string shape_path <- self.ask_dataset_path(DEFAULT_DATASET_FOLDER);

In my opinion all these manipulations of the path should be in experiments, not in the model/simulation. And they should only be available to initialize the model/simulation with the correct values. Ideally, then, the management of the dataset path should not be in Parameters.gaml, but in the Abstract Experiment.gaml file...

Temporal viral dynamic

Is your feature request related to a problem? Please describe.
For now when an individual enter a state, it acquire all variables value that change once, and nothing (or so) is modified since another state shift happen. For instance when someone enter latent phase, viral load should increase slowly until a threshold is met, triggering state change (in this case becoming infectious); the same way when one enter infectious phase, viral load should quickly shift to its maximum and then decline/explode/etc.

Describe the solution you'd like
Explicitly represent the disease states with viral load temporal dynamic, hence making it possible to anchor test results, state shift and infectiousness on dynamic variable, rather than the state per se

Describe alternatives you've considered
Having various random value to represent heterogeneity between states (more viral load during infectious state) and individuals (more viral load for super spreaders)

Additional context
When considering test failure and, in particular, false negatives, the timing of the test, that should reflect in very contrasting viral load, is quite important !

People working/going outside or coming from outside

For the moment, there is just an activity "a_trade" that concerns only buildings that are not in the world (i.e. not overlapping the world). I will be more realistic to consider a place "outside" with a specific dynamic (either no possibility to get infected or a certain probability given as a parameter).

No idea if we should take into account the people that come to the area for a specific activity.

Create default parameter files for synthetic population, synthetic agenda, activity and building weights

Parameter files organization

In order to illustrate the use of parameter files, we should have a snippet/default version of each one. Hence users will be able to produce they own based on the one provided, as it is already the case for epidemiological parameters.

It existe two types of parameter files: case specific one, to be placed in case study folder, and general purpose one, to be placed in a parameter file folder (default is COMOKIT/Parameters/).

Case study specific parameter files:

  • Synthetic population : in Ben Tre and Vinh Phuc case study (see 913a7da)
  • Agenda
  • Activity weights
  • Building types weights

General parameter files:

  • Epidemiological parameter file
  • Building types to activity types parameter file

Adding infectiousness according to time (not for V1, probably for V2)

It would be nice to add time-dependent infectiousness to the Individual agents or Biological entities.

A possible workaround would be to use the serial interval distribution as the infectiousness of an Individual at time t, after exposure.

One difficult part would be to consider the different infectious periods represented: should we truncate the serial interval distribution, or should we simply use it and try to find the parameters of the infectiousness through time according to the infectious period limits.

Missing file

GAMA is trying to look for Building type per activity type.csv (in Parameters folder) in the application model folder instead of COMOKIT folder when the application model is launch outside COMOKIT

Create one or two synthetic datasets (incl. a default one)

Would be nice to have one simple dataset used as a default-- or two, with different properties (for instance the size ?). The goal would be to exemplify the data needed for new case studies and to conduct faster experiments too when testing new functionalities.

Launch "Abstract Experiment with Parameters.gaml" throws an Exception

When I run the Abstract Experiment with Parameters.gaml experiment, I get the following exception:

2 occurrences in 2 agents at cycle 0: Java error: nil value detected
in file<int, geometry> shp_boundary <- file_exists(dataset + 'boundary.shp') ? file<int, geometry>(dataset + 'boundary.shp') : nil ;
NullPointerException: null
msi.gama.common.util.FileUtils.findInWorkspace(FileUtils.java:157)
msi.gama.common.util.FileUtils.constructAbsoluteFilePath(FileUtils.java:134)
msi.gaml.operators.Files.exist_file(Files.java:115)
gaml.additions.GamlAdditions.lambda$578(GamlAdditions.java:635)
msi.gaml.expressions.UnaryOperator._value(UnaryOperator.java:83)
msi.gaml.expressions.AbstractExpression.value(AbstractExpression.java:70)
msi.gaml.expressions.BinaryOperator._value(BinaryOperator.java:75)
when applying the file_exists operator on ../../Datasets/Ben Tre/boundary.shp
in initializing attribute shp_boundary
in agents Simulation 0, With parameters0

Note that this is first due to the fact that all the paths are defined for experiments located in a folder in the Experiment folder, whereas Abstract Experiment with Parameters.gaml is directly located in the Experiment folder.

In addition we can also question the file_exists operator as it returns an exception in the case where the path to the folder in which could be located the file does not exist.

Remove duplicates weight/range for building type in two different parameter files

Describe the bug
Not exactly a bug but a duplicates

One can attached weights to building types according to age and gender. This will adapt the selection of a particular building to carry out an activity taking into account attributes of the agent.

Those weights can be put in Building type per activity type.csv'' (as modifiers with a given syntax) or independently in Building type weights.csv''

Here is the thing : first one allows to define weights according to activity (but cannot combine age and gender modifiers), whereas the second one makes it possible to combine age and gender category (but not variation from one activity to another). Now they should be merged !

[GHA] Switch pre-release on GAMA 1.8.2

Describe the bug
The current pre-release of COMOKIT All-in-one is using the stable GAMA 1.8.1. To prepare the switch on GAMA 1.8.2 it would be great to switch the pre-release on that new version of GAMA.

Expected behavior
Changing the GitHub Action creating the pre-release to get the latest pre-release of GAMA 1.8.2 and make a regular pre-release with it.

NullPointerException on Headless experiment

Get an error when trying to launch COMOKIT with the GAMA Continuous w/ JDK on a generated XML from COMOKIT-HPC.

I'm trying to launch the Headless experiment from Significance of Wearing Masks.gaml

Here's my log :

$ ./COMOKIT/GAMA/headless/gama-headless.sh ~/COMOKIT/tmp/mask/mask-0.xml ~/COMOKIT/tmp/output
******************************************************************
* GAMA version 1.8                                               *
* http://gama-platform.org                                       *
* (c) 2007-2019 UMI 209 UMMISCO IRD/SU & Partners                *
******************************************************************
> JAI/ImageIO subsystem activated
Number of cpus used:16 (available: 16)
java.lang.NullPointerException
	at com.vividsolutions.jts.geom.Envelope.init(Envelope.java:254)
	at msi.gama.common.geometry.Envelope3D.init(Envelope3D.java:174)
	at msi.gama.common.geometry.Envelope3D.of(Envelope3D.java:75)
	at msi.gaml.operators.Spatial$Creation.envelope(Spatial.java:1408)
	at gaml.additions.GamlAdditions.lambda$413(GamlAdditions.java:470)
	at msi.gaml.expressions.UnaryOperator._value(UnaryOperator.java:84)
	at msi.gaml.expressions.AbstractExpression.value(AbstractExpression.java:70)
	at msi.gama.runtime.ExecutionScope.evaluate(ExecutionScope.java:499)
	at msi.gaml.variables.Variable.initializeWith(Variable.java:484)
	at msi.gama.metamodel.population.GamaPopulation.createAndUpdateVariablesFor(GamaPopulation.java:441)
	at msi.gama.metamodel.population.GamaPopulation.createVariablesFor(GamaPopulation.java:421)
	at msi.gama.kernel.simulation.SimulationPopulation.initSimulation(SimulationPopulation.java:121)
	at msi.gama.kernel.simulation.SimulationPopulation.createAgents(SimulationPopulation.java:96)
	at msi.gama.kernel.experiment.ExperimentAgent.createSimulation(ExperimentAgent.java:311)
	at msi.gama.kernel.experiment.ExperimentAgent._init_(ExperimentAgent.java:265)
	at msi.gama.metamodel.agent.MinimalAgent.init(MinimalAgent.java:216)
	at msi.gama.kernel.experiment.ExperimentAgent.init(ExperimentAgent.java:279)
	at msi.gama.runtime.ExecutionScope.init(ExecutionScope.java:432)
	at msi.gama.kernel.experiment.ExperimentScheduler.schedule(ExperimentScheduler.java:149)
	at msi.gama.kernel.experiment.ExperimentAgent.schedule(ExperimentAgent.java:332)
	at msi.gama.kernel.experiment.ExperimentPlan.open(ExperimentPlan.java:512)
	at msi.gama.runtime.GAMA.addHeadlessExperiment(GAMA.java:154)
	at msi.gama.headless.core.Experiment.loadCurrentExperiment(Experiment.java:77)
	at msi.gama.headless.core.Experiment.setup(Experiment.java:71)
	at msi.gama.headless.job.ExperimentJob.loadAndBuild(ExperimentJob.java:247)
	at msi.gama.headless.runtime.LocalSimulationRuntime$FakeApplication.run(LocalSimulationRuntime.java:214)
..........
Simulation duration: 69ms
java.lang.NullPointerException
	at com.vividsolutions.jts.geom.Envelope.init(Envelope.java:254)
	at msi.gama.common.geometry.Envelope3D.init(Envelope3D.java:174)
	at msi.gama.common.geometry.Envelope3D.of(Envelope3D.java:75)
	at msi.gaml.operators.Spatial$Creation.envelope(Spatial.java:1408)
	at gaml.additions.GamlAdditions.lambda$413(GamlAdditions.java:470)
	at msi.gaml.expressions.UnaryOperator._value(UnaryOperator.java:84)
	at msi.gaml.expressions.AbstractExpression.value(AbstractExpression.java:70)
	at msi.gama.runtime.ExecutionScope.evaluate(ExecutionScope.java:499)
	at msi.gaml.variables.Variable.initializeWith(Variable.java:484)
	at msi.gama.metamodel.population.GamaPopulation.createAndUpdateVariablesFor(GamaPopulation.java:441)
	at msi.gama.metamodel.population.GamaPopulation.createVariablesFor(GamaPopulation.java:421)
	at msi.gama.kernel.simulation.SimulationPopulation.initSimulation(SimulationPopulation.java:121)
	at msi.gama.kernel.simulation.SimulationPopulation.createAgents(SimulationPopulation.java:96)
	at msi.gama.kernel.experiment.ExperimentAgent.createSimulation(ExperimentAgent.java:311)
	at msi.gama.kernel.experiment.ExperimentAgent._init_(ExperimentAgent.java:265)
	at msi.gama.metamodel.agent.MinimalAgent.init(MinimalAgent.java:216)
	at msi.gama.kernel.experiment.ExperimentAgent.init(ExperimentAgent.java:279)
	at msi.gama.runtime.ExecutionScope.init(ExecutionScope.java:432)
	at msi.gama.kernel.experiment.ExperimentScheduler.schedule(ExperimentScheduler.java:149)
	at msi.gama.kernel.experiment.ExperimentAgent.schedule(ExperimentAgent.java:332)
	at msi.gama.kernel.experiment.ExperimentPlan.open(ExperimentPlan.java:512)
	at msi.gama.runtime.GAMA.addHeadlessExperiment(GAMA.java:154)
	at msi.gama.headless.core.Experiment.loadCurrentExperiment(Experiment.java:77)
	at msi.gama.headless.core.Experiment.setup(Experiment.java:71)
	at msi.gama.headless.job.ExperimentJob.loadAndBuild(ExperimentJob.java:247)
	at msi.gama.headless.runtime.LocalSimulationRuntime$FakeApplication.run(LocalSimulationRuntime.java:214)
..........
Simulation duration: 2ms
java.lang.NullPointerException
	at com.vividsolutions.jts.geom.Envelope.init(Envelope.java:254)
	at msi.gama.common.geometry.Envelope3D.init(Envelope3D.java:174)
	at msi.gama.common.geometry.Envelope3D.of(Envelope3D.java:75)
	at msi.gaml.operators.Spatial$Creation.envelope(Spatial.java:1408)
	at gaml.additions.GamlAdditions.lambda$413(GamlAdditions.java:470)
	at msi.gaml.expressions.UnaryOperator._value(UnaryOperator.java:84)
	at msi.gaml.expressions.AbstractExpression.value(AbstractExpression.java:70)
	at msi.gama.runtime.ExecutionScope.evaluate(ExecutionScope.java:499)
	at msi.gaml.variables.Variable.initializeWith(Variable.java:484)
	at msi.gama.metamodel.population.GamaPopulation.createAndUpdateVariablesFor(GamaPopulation.java:441)
	at msi.gama.metamodel.population.GamaPopulation.createVariablesFor(GamaPopulation.java:421)
	at msi.gama.kernel.simulation.SimulationPopulation.initSimulation(SimulationPopulation.java:121)
	at msi.gama.kernel.simulation.SimulationPopulation.createAgents(SimulationPopulation.java:96)
	at msi.gama.kernel.experiment.ExperimentAgent.createSimulation(ExperimentAgent.java:311)
	at msi.gama.kernel.experiment.ExperimentAgent._init_(ExperimentAgent.java:265)
	at msi.gama.metamodel.agent.MinimalAgent.init(MinimalAgent.java:216)
	at msi.gama.kernel.experiment.ExperimentAgent.init(ExperimentAgent.java:279)
	at msi.gama.runtime.ExecutionScope.init(ExecutionScope.java:432)
	at msi.gama.kernel.experiment.ExperimentScheduler.schedule(ExperimentScheduler.java:149)
	at msi.gama.kernel.experiment.ExperimentAgent.schedule(ExperimentAgent.java:332)
	at msi.gama.kernel.experiment.ExperimentPlan.open(ExperimentPlan.java:512)
	at msi.gama.runtime.GAMA.addHeadlessExperiment(GAMA.java:154)
	at msi.gama.headless.core.Experiment.loadCurrentExperiment(Experiment.java:77)
	at msi.gama.headless.core.Experiment.setup(Experiment.java:71)
	at msi.gama.headless.job.ExperimentJob.loadAndBuild(ExperimentJob.java:247)
	at msi.gama.headless.runtime.LocalSimulationRuntime$FakeApplication.run(LocalSimulationRuntime.java:214)
..........
Simulation duration: 1ms
java.lang.NullPointerException
	at com.vividsolutions.jts.geom.Envelope.init(Envelope.java:254)
	at msi.gama.common.geometry.Envelope3D.init(Envelope3D.java:174)
	at msi.gama.common.geometry.Envelope3D.of(Envelope3D.java:75)
	at msi.gaml.operators.Spatial$Creation.envelope(Spatial.java:1408)
	at gaml.additions.GamlAdditions.lambda$413(GamlAdditions.java:470)
	at msi.gaml.expressions.UnaryOperator._value(UnaryOperator.java:84)
	at msi.gaml.expressions.AbstractExpression.value(AbstractExpression.java:70)
	at msi.gama.runtime.ExecutionScope.evaluate(ExecutionScope.java:499)
	at msi.gaml.variables.Variable.initializeWith(Variable.java:484)
	at msi.gama.metamodel.population.GamaPopulation.createAndUpdateVariablesFor(GamaPopulation.java:441)
	at msi.gama.metamodel.population.GamaPopulation.createVariablesFor(GamaPopulation.java:421)
	at msi.gama.kernel.simulation.SimulationPopulation.initSimulation(SimulationPopulation.java:121)
	at msi.gama.kernel.simulation.SimulationPopulation.createAgents(SimulationPopulation.java:96)
	at msi.gama.kernel.experiment.ExperimentAgent.createSimulation(ExperimentAgent.java:311)
	at msi.gama.kernel.experiment.ExperimentAgent._init_(ExperimentAgent.java:265)
	at msi.gama.metamodel.agent.MinimalAgent.init(MinimalAgent.java:216)
	at msi.gama.kernel.experiment.ExperimentAgent.init(ExperimentAgent.java:279)
	at msi.gama.runtime.ExecutionScope.init(ExecutionScope.java:432)
	at msi.gama.kernel.experiment.ExperimentScheduler.schedule(ExperimentScheduler.java:149)
	at msi.gama.kernel.experiment.ExperimentAgent.schedule(ExperimentAgent.java:332)
	at msi.gama.kernel.experiment.ExperimentPlan.open(ExperimentPlan.java:512)
	at msi.gama.runtime.GAMA.addHeadlessExperiment(GAMA.java:154)
	at msi.gama.headless.core.Experiment.loadCurrentExperiment(Experiment.java:77)
	at msi.gama.headless.core.Experiment.setup(Experiment.java:71)
	at msi.gama.headless.job.ExperimentJob.loadAndBuild(ExperimentJob.java:247)
	at msi.gama.headless.runtime.LocalSimulationRuntime$FakeApplication.run(LocalSimulationRuntime.java:214)
..........
Simulation duration: 1ms
^C

and here's the XML :

<Experiment_plan>
	<Simulation experiment="Headless" finalStep="10" id="0" seed="125" sourcePath="/root/COMOKIT/COMOKIT-Model/Experiments/Physical Interventions/Significance of Wearing Masks.gaml">
		<Parameters>
			<Parameter name="Proportion wearing mask" type="FLOAT" value="0.5" var="init_all_ages_proportion_wearing_mask" />
			<Parameter name="Factor contact rate" type="FLOAT" value="0.5" var="init_all_ages_factor_contact_rate_wearing_mask" />
			<Parameter type="INT" value="125" var="idSimulation" />
			<Parameter type="STRING" value="/root/COMOKIT/batch_output/init_all_ages_proportion_wearing_mask_0.5-init_all_ages_factor_contact_rate_wearing_mask_0.5" var="result_folder" />
		</Parameters>
		<Outputs />
	</Simulation>

	[...]

</Experiment_plan>

Update Header of all gaml

To diffuse the model and call for data contribution, we should change the header notes of all gaml file to a one more officially . Actually, they are all (by copy and paste i think)
/***

  • Name: Corona
  • Author: hqngh
  • Description:
  • Tags: Tag1, Tag2, TagN
    ***/

Running batch experiment from ReplicationsSensitivity.gaml with facet keep_simulations to false raise exception at init

The batch simulations run smoothly, but as soon as keep_simulations facet is set to false, it raises an exception. It seems that experiment agent try to access variables from the simulation agent (see init {} block in Abstract batch experiment.gaml) :

1 occurence in Sensitivity0 at cycle 0: This experiment does not keep its simulations. DEFAULT_DATASETS_FOLDER_NAME cannot be retrieved in this context
in string build_dataset_path (string _datasets_folder_path <- project_path + DEFAULT_DATASETS_FOLDER_NAME, string _case_study_folder_name <- DEFAULT_CASE_STUDY_FOLDER_NAME)

Somehow related to a closed issue in Gama : https://github.com/gama-platform/gama/issues/2727

Adding contact tracing

An important intervention that we haven't implemented yet is contact tracing.
For a disease such as COVID-19, with a possibility of asymptomatic and presymptomatic transmissions, adding a policy that will look at the contacts in the last X days of an identified case is very important (even more than it is used by Vietnam, which is our "original" case study).

In order to implement that, we have different solutions:

  • either having a map defined in the Individual species, representing its last contact (i.e., step, possibly exposure duration) with another individual,

  • or having a matrix in global (NxN size, with N being the number of Individuals in the simulation)

The second idea might be better since defining the map of contacts in the Individual species might increase execution time, while the map would not be used for anything but this policy, wasting resources when the policy is not applied.

Generic parameters view

It would be nice to have an experiment (a virtual one) with all the parameters that can be set in the model, with all their ranges, default values, etc. and comments. So that one can simply copy/paste this into its own model / experiment.

Adding a more realistic testing policy

Currently, the testing policy is using three different parameters: the capacity in terms of test per hour, testing only symptomatic people, and allowing tests on the same Individual at different time steps.

While this is useful, it still remains over-simplistic. I've looked at the data in terms of testing (PCR) capacity for Vinh Phuc, and actually, there is none. This does not automatically means that no testing should be performed, but that samples are being sent to another province/clinic.

This "trip" should be represented, as it may induce a delay between the test being performed and the response (i.e. sending the Individual to quarantine, for instance), possibly letting one infectious Individual infecting others.

One possible way would be to keep in memory tests being perform for an Individual in a map, and "release" the answer after X steps (days) have passed. This delay would be added as an attribute of the new DelayedDetectionPolicy.

Read agenda generated from an external source

Is your feature request related to a problem? Please describe.
Currently any population generated from an external source can be read if they are listed in a csv file. However, activity agenda can be only generated by the synthetic agenda generator. Would it be possible to read in an activity agenda generated from an external source (e.g., activity-based transport demand model or activity-travel diary data)?

Describe the solution you'd like
Activity agenda in an activity-travel diary format can be read in by COMOKIT in accordance with the population.

Describe alternatives you've considered
For the initialization of the agenda, users may choose between reading an agenda file (if any) or generating the agenda by the synthetic agenda generator.

Additional context
Since the activity-travel diary data is being collected annually by most countries, and it has been utilized as a basis of agent-based modeling, it would be nice to have such a module not only for COMOKIT but also for GAMA as a general plugin.

Refresh facet in Permanent displays is not properly used

Describe the bug
When launching Comparison Of 3 Measures.gaml or Comparison Of Local Containments.gaml experiment the permanent display for infected cases remain flat although the actual value number_of_infectious is rising. The issue come from the refresh facets used with the every statement: if you use "real time" metrics it does not work (e.g. every(24#hour)) whereas when you use #cycle it works properly.

To Reproduce
Steps to reproduce the behavior:
Launch launching Comparison Of 3 Measures.gaml or Comparison Of Local Containments.gaml experiment

Expected behavior
Facet should work using "real time" metrics

Desktop (please complete the following information):

  • COMOKIT 1.0.1
  • Gama 1.8.1

Role of Hospitals

For the moment, they have no particular function (we just have a patient visiting activity). Do we have to add more things: it is a place of transmission - see the latest news from Hanoi, but also of care (quarantine) for symptomatic patients.

Ben Tre dataset: Java error: ConcurrentModificationException

Just pull and launch today version and after around 200+ cycle , i get:
2 occurrences in 2 agents at cycle 251: Java error: ConcurrentModificationException
in ask bound.individuals where (flip(successful_contact_rate_human * reduction_factor) and (each.status = susceptible)) {
do defineNewCase ;
}

ConcurrentModificationException: null
java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1388)
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
one.util.streamex.AbstractStreamEx.rawCollect(AbstractStreamEx.java:68)
when applying the where operator on [Individual(2547),Individual(180),Individual(180),Individual(194),Individual(463),Individual(464),Individual(463),Individual(464),Individual(682),Individual(682),Individual(1173),Individual(1445),Individual(1173),Individual(1568),Individual(1445),Individual(1568),Individual(2435),Individual(2435),Individual(1553),Individual(1553)] and flip(successful_contact_rate_human * reduction_factor) and (each.status = susceptible)
in ask bound.individuals where (flip(successful_contact_rate_human * reduction_factor) and (each.status = susceptible)) {
do defineNewCase ;
}

in agents Individual180, No Containment

On/off for the main dynamics

We should have a number of boolean switches (attributes for simulations) that would allow to switch entire dynamics of the model on or off. For instance the environmental transmission, etc.

More realistic mask wearing (not for V1, probably for V2)

Masks are an important policy of our model, as the scientific community is still on debate about their usage.
We currently represent masks by having one probability for an Individual to wear a mask that is computed at each step. This probability is, currently, not depending on the epidemiological status of the Individual: the probability is the same for symptomatic, asymptomatic and even not-infected people. While I think the last two should still have the same values (i.e. there should not be a difference in terms of behaviours between an asymptomatic/presymptomatic and not infected individual).
I think symptomatic Individuals should have their own probability of wearing a mask (having symptoms tends to make you wear a mask more than someone not having symptoms, depending on the population of interest), which could possibly impacted by policies (if you are tested positive, for instance).

Vinh Phuc Buildings are blank and error when simulation launch

2 occurrences in 2 agents at cycle 0: Java error: nil value detected
in geometry shape <- envelope(shp_buildings) ;
NullPointerException: null
com.vividsolutions.jts.geom.Envelope.init(Envelope.java:254)
msi.gama.common.geometry.Envelope3D.init(Envelope3D.java:174)
msi.gama.common.geometry.Envelope3D.of(Envelope3D.java:75)
msi.gaml.operators.Spatial$Creation.envelope(Spatial.java:1406)
gaml.additions.GamlAdditions.lambda$376(GamlAdditions.java:433)
msi.gaml.expressions.UnaryOperator._value(UnaryOperator.java:83)
msi.gaml.expressions.AbstractExpression.value(AbstractExpression.java:70)
when applying the envelope operator on null
in initializing attribute shape
in create simulation with: [dataset::shape_path] {
name <- 'School closed';
ask Authority {
policies <+ noSchool;
}

}

in action init {
string shape_path <- self.ask_dataset_path();
create simulation with: [dataset::shape_path] {
name <- 'School closed';
ask Authority {
policies <+ noSchool;
}

}

create simulation with: [dataset::shape_path] {
	name <- 'No Containment';
	ask Authority  {
		policies <+ noContainment;
	}

}

create simulation with: [dataset::shape_path] {
	name <- 'Home Containment';
	ask Authority  {
		policies <+ lockDown;
	}

}

}

in agents Simulation 0, Comparison0

image

gen_population_generator is not a valid type name

Describe the bug
I have recently encountered some issues while using the GAMA code that you have published. When running the following code in the screenshots.The software tell me "gen_population_generator is not a valid type name",and the whole block of code cannot run.

Screenshots
截屏2023-06-24 23 13 27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.