MATSIM
Public Member Functions | Private Attributes | List of all members
org.matsim.households.PersonHouseholdMapping Class Reference

Public Member Functions

 PersonHouseholdMapping (Households hhs)
 
void reinitialize (Households hhs)
 
Household getHousehold (Id< Person > personId)
 

Private Attributes

final Map< Id< Person >, HouseholdphMap = new IdMap<>(Person.class)
 

Detailed Description

Tiny helper to get the household associated with a person's id.

Author
dgrether

Definition at line 34 of file PersonHouseholdMapping.java.

Constructor & Destructor Documentation

◆ PersonHouseholdMapping()

org.matsim.households.PersonHouseholdMapping.PersonHouseholdMapping ( Households  hhs)

Definition at line 38 of file PersonHouseholdMapping.java.

References org.matsim.households.PersonHouseholdMapping.reinitialize().

38  {
39  this.reinitialize(hhs);
40  }
Here is the call graph for this function:

Member Function Documentation

◆ reinitialize()

void org.matsim.households.PersonHouseholdMapping.reinitialize ( Households  hhs)

Definition at line 42 of file PersonHouseholdMapping.java.

References org.matsim.households.Households.getHouseholds().

Referenced by org.matsim.households.PersonHouseholdMapping.PersonHouseholdMapping().

42  {
43  this.phMap.clear();
44  for (Household h : hhs.getHouseholds().values()){
45  for (Id<Person> member : h.getMemberIds()){
46  this.phMap.put(member, h);
47  }
48  }
49 
50  }
final Map< Id< Person >, Household > phMap
Here is the call graph for this function:

◆ getHousehold()

Household org.matsim.households.PersonHouseholdMapping.getHousehold ( Id< Person personId)

Definition at line 52 of file PersonHouseholdMapping.java.

52  {
53  return this.phMap.get(personId);
54  }
final Map< Id< Person >, Household > phMap

Member Data Documentation

◆ phMap

final Map<Id<Person>, Household> org.matsim.households.PersonHouseholdMapping.phMap = new IdMap<>(Person.class)
private

Definition at line 36 of file PersonHouseholdMapping.java.


The documentation for this class was generated from the following file: