Skip to content

Commit

Permalink
Merge branch 'master' into kmt_UpdateDtdToTriggerWorkflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 authored Nov 26, 2024
2 parents 11372e7 + 22e891b commit 5eb6b61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/deploy-dtds.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: deploy-dtds-on-website

on:
push:
branches:
- master
pull_request:
types:
- closed
paths:
- matsim/src/main/resources/dtd
- 'matsim/src/main/resources/dtd/**'

jobs:
rsync-dtds:
if: github.event.pull_request.merged == true // only if PR closed by merging
name: sync DTDs to website
runs-on: ubuntu-latest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class SquareGridZoneSystem implements GridZoneSystem {

private final IdMap<Zone, Zone> zones = new IdMap<>(Zone.class);

private final IdMap<Zone, List<Link>> zoneToLinksMap = new IdMap<>(Zone.class);
private final Map<Integer, List<Link>> index2Links;
private final Network network;

Expand Down Expand Up @@ -114,7 +113,7 @@ public Optional<Zone> getZoneForCoord(Coord coord) {

@Override
public List<Link> getLinksForZoneId(Id<Zone> zone) {
return zoneToLinksMap.get(zone);
return this.index2Links.get(Integer.parseInt(zone.toString()));
}

private Optional<Zone> getOrCreateZone(Coord coord) {
Expand All @@ -129,12 +128,6 @@ private Optional<Zone> getOrCreateZone(Coord coord) {
if(zoneFilter.test(zone)) {
internalZones[index] = zone;
zones.put(zone.getId(), zone);
List<Link> linkList = zoneToLinksMap.computeIfAbsent(zone.getId(), zoneId -> new ArrayList<>());
List<Link> links = index2Links.get(index);
if(links!=null)
{
linkList.addAll(links);
}
} else {
return Optional.empty();
}
Expand Down

0 comments on commit 5eb6b61

Please sign in to comment.