Skip to content

get_population

Syntax

get_population()

Returns

A list of ordinary agent IDs that occur in the population.

Description

This action can be used to retrieve a list of the ordinary agent IDs of the population file that was read into FRED on launch.

Examples

simulation {
    population_version = US_2010.v5
    locations = Jefferson_County_PA
    start_date = 2020-Jan-01
    end_date = 2020-Jan-01
}

variables {
    shared list population
}

condition TransmissionTest {
    meta_start_state = MetaStart

    state MetaStart {
        population = get_population()
        print("First ID in Jefferson County: ", population[0])
        print("Last ID in Jefferson County: ", last(population))
        print("Number of IDs in Jefferson County: ", length(population))
        wait()
        default()
    }
}

See Also