Skip to content

Commit

Permalink
Merge pull request #160 from corning-incorporated/alpha
Browse files Browse the repository at this point in the history
Alpha to main with minor bug fixes
  • Loading branch information
mreveil authored Dec 9, 2020
2 parents 333f6d2 + 84842ab commit bd4a95e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

Covid-19 Indoor Transmission Agent-based Modeling platform.

When you use CITAM to model your facility (e.g. a school, a manufacturing facility, an office building, etc.), it creates a "virtual" version of that facility and simulates the movement of individuals while keeping track of time and location of contact events as well as the individuals involved. You can vary different input parameters such as number of people, number of shifts and traffic patterns and compare the contact statistics to find the best mitigation strategy to limit transmission within your facility.
When you use CITAM to model your facility (e.g. a manufacturing facility, an office building, etc.), it creates a "virtual" version of that facility and simulates the movement of individuals while keeping track of time and location of contact events as well as the individuals involved. You can vary different input parameters such as number of people, number of shifts, scheduling rules, etc. and compare contact statistics to find the best mitigation strategy to limit transmission within your facility.

As a simulation platform, CITAM does not implement nor does it support real-world tracking of visitors, employees or other people within the facilities of interest. CITAM actually provides an alternative to that approach by allowing a simulation to be used to assess and understand the implications of
various mitigation policies. At its core, CITAM is an agent-based
modeling platform. However, CITAM implements special features that make it
possible to mimic daily activities in various indoor environments.
As a simulation platform, CITAM does not implement nor does it support real-world tracking of visitors, employees or other people within the facilities of interest. CITAM actually provides an alternative to that approach by allowing a simulation to be used to assess and understand the implications of various mitigation policies. At its core, CITAM is an agent-based modeling platform. However, CITAM implements special features that make it possible to mimic daily activities in various indoor environments.

## Contents

[Basic Requirements](#basic-requirements)

[Installaton](#install-citam)

[Add New Facilities](#add-facilities)

[Run Simulations](#run-simulations)

[Visualize Results](#visualize-results)

[Contributing](#contributing)

[License](#license)


## Basic Requirements

The primary requirement to use CITAM is to have a map of each floor of each facility in SVG format for ingestion as well as some metadata about each space in each floorplan. For a list of required metadata, please visit the input requirements section of the documentation. Example input files are also available in the [examples](examples/) folder in this git repository.

Expand All @@ -23,8 +39,6 @@ Once a facility is successfully ingested into CITAM, any number of simulations c

CITAM is built as a cross-platform software compatible with all major operating systems. The primary way of using CITAM is currently through the command-line. CITAM is also shipped with a web-based dashboard to visualize simulation results.

## Getting Started
--------------
## Install CITAM

### Pre-requisite: Python 3.x
Expand All @@ -41,7 +55,7 @@ Below are the different ways to install CITAM.

### From Python-Wheel (Recommended)

1. Download the python-wheel [here](https://github.com/corning-incorporated/citam/actions/runs/292437599) (TODO: Update link to a release tag).
1. Download the python-wheel [here](https://github.com/corning-incorporated/citam/suites/1623194277/artifacts/29845594) (TODO: Update link to a release tag).
2. Extract the compressed file locally,
3. change directory to the extracted python-wheel folder. Do not rename this file.
4. run `pip install <citam wheel>` where citam_wheel is the extracted .whl file
Expand Down
6 changes: 3 additions & 3 deletions citam/engine/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ def step(
{}
] * self.facility.number_of_floors # One per floor

active_agents, moving_agents = self.move_agents()
active_agents, _ = self.move_agents()

if len(moving_agents) > 1 and not self.dry_run:
if len(active_agents) > 1 and not self.dry_run:
# At least 2 agents required
moving_active_agents = [
a for a in moving_agents if a.current_location is not None
a for a in active_agents if a.current_location is not None
]
self.identify_contacts(moving_active_agents)

Expand Down
7 changes: 3 additions & 4 deletions citam/engine/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ def ingest_floorplan(
if not os.path.isfile(svg):
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), svg)

if not os.path.isfile(csv):
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), csv)

if output_directory is None:
floor_directory = su.get_datadir(facility, floor)
if not os.path.isdir(floor_directory):
Expand All @@ -109,7 +106,7 @@ def ingest_floorplan(
floorplan_ingester = FloorplanIngester(
svg,
scale,
csv,
csv_file=csv,
buildings_to_keep=buildings,
extract_doors_from_file=True,
)
Expand Down Expand Up @@ -295,9 +292,11 @@ def run_simulation(inputs: dict):
floorplans,
model_inputs["entrances"],
model_inputs["facility_name"],
traffic_policy=model_inputs["traffic_policy"],
)
del model_inputs["entrances"]
del model_inputs["facility_name"]
del model_inputs["traffic_policy"]

model_inputs["facility"] = facility
my_model = FacilityTransmissionModel(**model_inputs)
Expand Down
2 changes: 1 addition & 1 deletion citam/engine/map/ingester.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def read_data_from_svg_file(self):
(
self.space_paths,
self.space_attributes,
self.door_pathsparser,
self.door_paths,
) = parser.parse_standalone_svg_floorplan_file(self.svg_file)

def read_data_from_csv_and_svg_files(self):
Expand Down
1 change: 1 addition & 0 deletions citam/tests/engine/test_main_export_nav_run_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_run_simulation_no_issues(datadir, tmpdir, monkeypatch):
"meetings_policy_params": None,
"scheduling_policy": None,
"output_directory": tmpdir,
"traffic_policy": None,
}
monkeypatch.setenv("CITAM_CACHE_DIRECTORY", str(datadir))
main.run_simulation(inputs_dict)
Expand Down

0 comments on commit bd4a95e

Please sign in to comment.