diff --git a/agent_based_epidemic_sim/agent_synthesis/agent_sampler.cc b/agent_based_epidemic_sim/agent_synthesis/agent_sampler.cc index 24d896be..bfdaeb53 100644 --- a/agent_based_epidemic_sim/agent_synthesis/agent_sampler.cc +++ b/agent_based_epidemic_sim/agent_synthesis/agent_sampler.cc @@ -16,7 +16,7 @@ namespace abesim { namespace { -constexpr int64 kPopulationProfileId = 0; +constexpr int64_t kPopulationProfileId = 0; } // namespace AgentProto ShuffledLocationAgentSampler::Next() { diff --git a/agent_based_epidemic_sim/agent_synthesis/shuffled_sampler.cc b/agent_based_epidemic_sim/agent_synthesis/shuffled_sampler.cc index ddb81213..4984af22 100644 --- a/agent_based_epidemic_sim/agent_synthesis/shuffled_sampler.cc +++ b/agent_based_epidemic_sim/agent_synthesis/shuffled_sampler.cc @@ -21,7 +21,7 @@ namespace abesim { ShuffledSampler::ShuffledSampler( - const absl::flat_hash_map& uuids_to_sizes) { + const absl::flat_hash_map& uuids_to_sizes) { for (auto key_val : uuids_to_sizes) { for (int i = 0; i < key_val.second; ++i) { slots_.push_back(key_val.first); @@ -30,25 +30,25 @@ ShuffledSampler::ShuffledSampler( std::shuffle(slots_.begin(), slots_.end(), GetBitGen()); } -int64 ShuffledSampler::Next() { +int64_t ShuffledSampler::Next() { DCHECK(i_ < slots_.size()); return slots_[i_++]; } std::unique_ptr MakeBusinessSampler( - const GammaDistribution& business_distribution, const int64 population_size, - const UuidGenerator& uuid_generator, + const GammaDistribution& business_distribution, + const int64_t population_size, const UuidGenerator& uuid_generator, std::vector* locations) { auto business_size_distribution = std::gamma_distribution( business_distribution.alpha(), business_distribution.beta()); std::mt19937 rng; - absl::flat_hash_map uuid_to_sizes; + absl::flat_hash_map uuid_to_sizes; for (int population = 0; population < population_size;) { LocationProto location; location.mutable_reference()->set_uuid(uuid_generator.GenerateUuid()); location.mutable_reference()->set_type(LocationReference::BUSINESS); const int size = - std::min(static_cast(business_size_distribution(rng)), + std::min(static_cast(business_size_distribution(rng)), population_size - population); location.mutable_dense()->set_size(size); locations->push_back(location); @@ -61,11 +61,11 @@ std::unique_ptr MakeBusinessSampler( std::unique_ptr MakeHouseholdSampler( const DiscreteDistribution& household_distribution, - const int64 population_size, const UuidGenerator& uuid_generator, + const int64_t population_size, const UuidGenerator& uuid_generator, std::vector* locations) { auto household_size_sampler = - DiscreteDistributionSampler::FromProto(household_distribution); - absl::flat_hash_map uuid_to_sizes; + DiscreteDistributionSampler::FromProto(household_distribution); + absl::flat_hash_map uuid_to_sizes; for (int population = 0; population < population_size;) { LocationProto location; location.mutable_reference()->set_uuid(uuid_generator.GenerateUuid());