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

Public Member Functions

 VehicleHouseholdMapping (Households hhs)
 
void reinitialize (Households hhs)
 
Household getHousehold (Id< Vehicle > vehicleId)
 

Private Attributes

final Map< Id< Vehicle >, HouseholdvhMap = new IdMap<>(Vehicle.class)
 

Detailed Description

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

Author
dgrether

Definition at line 36 of file VehicleHouseholdMapping.java.

Constructor & Destructor Documentation

◆ VehicleHouseholdMapping()

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

Definition at line 40 of file VehicleHouseholdMapping.java.

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

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

Member Function Documentation

◆ reinitialize()

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

Definition at line 44 of file VehicleHouseholdMapping.java.

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

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

44  {
45  this.vhMap.clear();
46  for (Household h : hhs.getHouseholds().values()) {
47  for (Id<Vehicle> vehicle : h.getVehicleIds()) {
48  this.vhMap.put(vehicle, h);
49  }
50  }
51  }
final Map< Id< Vehicle >, Household > vhMap
Here is the call graph for this function:

◆ getHousehold()

Household org.matsim.households.VehicleHouseholdMapping.getHousehold ( Id< Vehicle vehicleId)

Definition at line 53 of file VehicleHouseholdMapping.java.

53  {
54  return this.vhMap.get(vehicleId);
55  }
final Map< Id< Vehicle >, Household > vhMap

Member Data Documentation

◆ vhMap

final Map<Id<Vehicle>, Household> org.matsim.households.VehicleHouseholdMapping.vhMap = new IdMap<>(Vehicle.class)
private

Definition at line 38 of file VehicleHouseholdMapping.java.


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