-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into someFixesForSmaleScaleCommercial
- Loading branch information
Showing
6 changed files
with
109 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...rg/matsim/smallScaleCommercialTrafficGeneration/prepare/LanduseDataConnectionCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.matsim.smallScaleCommercialTrafficGeneration.prepare; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
/** | ||
* Interface for creating the connection between landuse or building categories and the required employee data categories for the simulation. | ||
* | ||
* @author Ricardo Ewert | ||
*/ | ||
public interface LanduseDataConnectionCreator { | ||
Map<String, List<String>> createLanduseDataConnection(); | ||
|
||
/** | ||
* Counts the number of employee categories in which a type is represented. | ||
* | ||
* @return | ||
*/ | ||
static int getNumberOfEmployeeCategoriesOfThisTyp(Map<String, List<String>> landuseCategoriesAndDataConnection, String type) { | ||
AtomicInteger count = new AtomicInteger(); | ||
landuseCategoriesAndDataConnection.values().forEach(list -> { | ||
if (list.contains(type)) { | ||
count.getAndIncrement(); | ||
} | ||
}); | ||
return count.get(); | ||
} | ||
|
||
; | ||
} |
32 changes: 32 additions & 0 deletions
32
...mallScaleCommercialTrafficGeneration/prepare/LanduseDataConnectionCreatorForOSM_Data.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.matsim.smallScaleCommercialTrafficGeneration.prepare; | ||
|
||
import java.util.*; | ||
|
||
/** | ||
* This class creates the connection between the landuse categories of the OSM landuse data and the employee data. | ||
* | ||
* @author Ricardo Ewert | ||
*/ | ||
public class LanduseDataConnectionCreatorForOSM_Data implements LanduseDataConnectionCreator{ | ||
|
||
@Override | ||
public Map<String, List<String>> createLanduseDataConnection() { | ||
Map<String, List<String>> landuseCategoriesAndDataConnection = new HashMap<>(); | ||
landuseCategoriesAndDataConnection.put("Inhabitants", | ||
new ArrayList<>(Arrays.asList("residential", "apartments", "dormitory", "dwelling_house", "house", | ||
"retirement_home", "semidetached_house", "detached"))); | ||
landuseCategoriesAndDataConnection.put("Employee Primary Sector", new ArrayList<>( | ||
Arrays.asList("farmyard", "farmland", "farm", "farm_auxiliary", "greenhouse", "agricultural"))); | ||
landuseCategoriesAndDataConnection.put("Employee Construction", | ||
new ArrayList<>(List.of("construction"))); | ||
landuseCategoriesAndDataConnection.put("Employee Secondary Sector Rest", | ||
new ArrayList<>(Arrays.asList("industrial", "factory", "manufacture", "bakehouse"))); | ||
landuseCategoriesAndDataConnection.put("Employee Retail", | ||
new ArrayList<>(Arrays.asList("retail", "kiosk", "mall", "shop", "supermarket"))); | ||
landuseCategoriesAndDataConnection.put("Employee Traffic/Parcels", new ArrayList<>( | ||
Arrays.asList("commercial", "post_office", "storage", "storage_tank", "warehouse"))); | ||
landuseCategoriesAndDataConnection.put("Employee Tertiary Sector Rest", new ArrayList<>( | ||
Arrays.asList("commercial", "embassy", "foundation", "government", "office", "townhall"))); | ||
return landuseCategoriesAndDataConnection; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters