New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what edges does add_boundary_penalties consider? #62

Closed
lizlaw opened this Issue Feb 15, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@lizlaw
Copy link

lizlaw commented Feb 15, 2018

Hi gang,
Just developing a problem where we want to use the add_boundary_penalties function.
Richard has let me know that the edge_factor call here only applies to the edges of your planning unit file, and not to the edges within this that are created when you lock-out areas.
I guess that lock-out areas could just be removed from the planning unit file to start to force these edges to be counted, but perhaps to start you might mention this in the call description, and later maybe consider creating two versions of edge_factor parameters for the different types of edges?
Thanks a million, loving prioritizr!
liz

@jeffreyhanson

This comment has been minimized.

Copy link
Contributor

jeffreyhanson commented Feb 18, 2018

Hi,

I'm glad to hear you're enjoying prioritizr. I think I understand your question, but please correct me if I'm missing something.

The edge_factor and penalty factors are used to assign a "boundary penalty" to each "edge" on a planning unit. The "boundary penalty" is calculated as length of edge * penalty * ifelse(edge has no neighbour, edge_factor, 1). This means that edges on planning units that have no neighbours---which should in theory be located on the outer edge of the study area, e.g. along coastline---can be systematically assigned a different penalty to normal interior edges.

My impression is that the edge factor concept is used to assign a lower penalty to planning units along coastlines, so that solutions don't simply avoid planning units along coastlines. But, if you have an a priori reason to penalise the boundaries on certain planning units, then I would suggest manually specifying a matrix containing the "boundary penalties" using the boundary_data argument (see https://prioritizr.github.io/prioritizr/reference/add_boundary_penalties.html).

Let if me know if I've completely misunderstood your question or if that answer helps.

@lizlaw

This comment has been minimized.

Copy link

lizlaw commented Feb 18, 2018

Hey Jeff,

Great, so looks like I was understanding it correctly. Though it does sound like we might need to make a more complex boundary penalty matrix, perhaps, which is why I wanted to clarify things.

In our current case we have country borders that we need to be wary of, on some sides of our area. We also have many roads and railways we have to exclude and buffer within our area. And several existing PAs. The challenge comes as we only have area as cost, and presence-absence species, so connectivity specifications are a strong driver of the solutions. Without connectivity specifications the selections are too scattered. But we don't necessarily want these existing protected areas to 'seed' solutions around them (we end up getting mega protected areas).

So you can perhaps see how we might want to have the edge_factor applying also to edges created by the lock-out files as well as just the outside edges. I see now how easy that will be using the boundary_data argument, by specifying a pu - lockin/lockout layer :)

I guess that means what I'd recommend is for the eqn above to be noted in the reference, and that when it is called through the add_boundary_penalties this only applies to the planning unit file, rather than the planning unit - lockout file.

Cheers!
Liz

@jeffreyhanson

This comment has been minimized.

Copy link
Contributor

jeffreyhanson commented Feb 18, 2018

Ok, great! Yeah, I agree that it would be good to have that equation in the docs for add_boundary_penalites. If you think that addresses your question, I'll close this issue when I've updated the docs?

jeffreyhanson added a commit that referenced this issue Feb 18, 2018

@lizlaw

This comment has been minimized.

Copy link

lizlaw commented Feb 19, 2018

Sounds great, thanks again!

@jeffreyhanson

This comment has been minimized.

Copy link
Contributor

jeffreyhanson commented Feb 19, 2018

Ok, I'll close the issue - thanks again for raising this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment