Skip to content

Fighting greed #478

@erik-vos

Description

@erik-vos

Copying a comment of mine in #435: (see next comment for additional info)

I think I have found another case where a valid rotation is not allowed. It is in 1826 that I'm now working on.
1825-Rotation-problem
The green tile 23 that I'm trying to lay on the hex NW of Paris is only allowed in this rotation, not in the equally valid 180° rotated one.

Muddling through the rotation code jungle, the root cause seems to be that the SE side of that hex is marked as "GREEDY".*
Does that really mean that no token is present behind that side (i.e. in Paris NW)? Well, that token is there, and the train routing code finds it well enough, see the pink line.

Is there anyone around who can explain this?

Talking about greediness, there are four possible enum values for that field: SEEN, DONE, GREEDY and NOT_GREEDY.
No documentation, of course. Can anyone explain the meaning of these values to me?

This all looks needlessly complicated. I'm thinking of replacing the code to find valid tile rotations by just a simple check: is there a token in any given direction, or not.

I don't know if the Chesapeake problem has the same cause, perhaps it is worth a check.

* See NetworkGraph.getReachableSides().126

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions