get_population()

Returns a list of the ordinary agents and group agents in a population.

Synopsis

get_population()

Description

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

Returns

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

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()
            next()
    }
}

See Also

list()