This is pseudocode for what it looks like the end-condition and target aliasing does:
for each endCondition in endConditionsList:
for each target in targetAlias:
try:
goodTarget = find target
fail:
next target
if goodTarget then break
else next endCondition
This is the pseudocode for what I think it should be (at the user's option, if not across the board):
for each target in targetAlias:
for each endCondition in endConditionsList:
try:
find target
goodEndCondition = endCondition
break
fail:
next endCondition
next target
I have a corridor whose end condition to the right is for a depressed median, and it should be targeting the right lane's surface to the left where possible (namely, fill), but otherwise it should find the existing terrain if it can't find the proposed surface of the right lane. The left lane's template has end conditions in what may be a predictable order, each of them targeting <Active>:
- Minimum typical cut section
- Deeper-than-minimum special ditch section
- Typical fill section
Alias <Active> has two targets: 1) the right lane surface, and 2) the existing surface. I am not using nearest.
What I find is that the template looks first at the EC in priority 1 position. It doesn't find the right lane surface, so it finds the existing surface. End of story.
If I delete the existing surface from <Active>, the EC in priority 1 position fails, so it falls back to priority 2 and priority 3, and finally finds the fill section solution.
What I'm suggesting here is that if I want my corridor to find a parallel roadway's proposed surface in a fill condition before it finds the existing surface in a cut section, it should do that.
The reason I think it should be across the board is because if a user wants their template to find a certain surface, they probably don't care whether it's in a cut section or fill section. They want it to be found. And the fact that the user has the targets listed as he does, the user probably expects the first entry to be the preferred entry across all end conditions, not just for the highest-priority end condition.