public void readJobs(ActivityFacilitiesImpl opportunities,final ActivityFacilitiesImpl parcelsOrZones,final boolean isParcel){
  String filename=module.getMATSim4OpusTemp() + InternalConstants.URBANSIM_JOB_DATASET_TABLE + this.year+ InternalConstants.FILE_TYPE_TAB;
  Map<Id<ActivityFacility>,? extends ActivityFacility> facilityMap=parcelsOrZones.getFacilities();
  try {
    BufferedReader reader=IOUtils.getBufferedReader(filename);
    String line=reader.readLine();
    Map<String,Integer> idxFromKey=HeaderParser.createIdxFromKey(line,InternalConstants.TAB);
    int indexJobID=idxFromKey.get(InternalConstants.JOB_ID);
    int indexParcelID=-1;
    int indexZoneID=idxFromKey.get(InternalConstants.ZONE_ID_WORK);
    if (isParcel)     indexParcelID=idxFromKey.get(InternalConstants.PARCEL_ID_WORK);
    while ((line=reader.readLine()) != null) {
      String[] parts=line.split(InternalConstants.TAB);
      Id<ActivityFacility> jobId=Id.create(parts[indexJobID],ActivityFacility.class);
      if (isParcel) {
        Id<ActivityFacility> parcelId=Id.create(parts[indexParcelID],ActivityFacility.class);
        ActivityFacility parcel=facilityMap.get(parcelId);
        opportunities.createAndAddFacility(jobId,parcel.getCoord());
      }
 else {
        Id zoneId=Id.create(parts[indexZoneID],ActivityFacility.class);
        ActivityFacility zone=facilityMap.get(zoneId);
        opportunities.createAndAddFacility(jobId,zone.getCoord());
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

public void readJobs ( ActivityFacilitiesImpl opportunities , final ActivityFacilitiesImpl parcelsOrZones , final boolean isParcel ) { String filename = module . getMATSim4OpusTemp ( ) + InternalConstants . URBANSIM_JOB_DATASET_TABLE + this . year + InternalConstants . FILE_TYPE_TAB ; Map < Id < ActivityFacility > , ? extends ActivityFacility > facilityMap = parcelsOrZones . getFacilities ( ) ; try { BufferedReader reader = IOUtils . getBufferedReader ( filename ) ; String line = reader . readLine ( ) ; Map < String , Integer > idxFromKey = HeaderParser . createIdxFromKey ( line , InternalConstants . TAB ) ; int indexJobID = idxFromKey . get ( InternalConstants . JOB_ID ) ; int indexParcelID = - 1 ; int indexZoneID = idxFromKey . get ( InternalConstants . ZONE_ID_WORK ) ; if ( isParcel ) indexParcelID = idxFromKey . get ( InternalConstants . PARCEL_ID_WORK ) ; while ( ( line = reader . readLine ( ) ) != null ) { String [ ] parts = line . split ( InternalConstants . TAB ) ; Id < ActivityFacility > jobId = Id . create ( parts [ indexJobID ] , ActivityFacility . class ) ; if ( isParcel ) { Id < ActivityFacility > parcelId = Id . create ( parts [ indexParcelID ] , ActivityFacility . class ) ; ActivityFacility parcel = facilityMap . get ( parcelId ) ; opportunities . createAndAddFacility ( jobId , parcel . getCoord ( ) ) ; } else { Id zoneId = Id . create ( parts [ indexZoneID ] , ActivityFacility . class ) ; ActivityFacility zone = facilityMap . get ( zoneId ) ; opportunities . createAndAddFacility ( jobId , zone . getCoord ( ) ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } }
reading jobs and creating activity facilities
