intercept.set: Manage intercept lists for select link analysis on highway...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Keep track of select link and select zone information for highway assignments.

Usage

1
new.intercept.set(links, filter.od = NULL)

Arguments

links

A logical vector with one entry per link in the network; links marked as TRUE are “selected”

filter.od

A function that takes a demand matrix and returns the same matrix, except with zeroes in cells corresponding to origin/destination pairs that are NOT of interest

Details

This function returns an intercept set, a list with two elements corrsponding to its parameters. If the filter.od function is not supplied (the default), a stand-in function is created that simply returns its parameter. Otherwise, filter.od is defined as:

1
filter.od(od)

and it returns its (numeric matrix) parameter od, but puts zeroes in any cell corresponding to an origin/destination pair that is not of interest, even if its path crosses one of the selected links.

Internally, this structure is used by build.intercepts.

Most users will set the highway assignment control parameter intercept to an intercept set to perform select link analysis. See highway.assign for details.

Value

Returns a list suitable for use with the build.intercepts function.

Author(s)

Jeremy Raw

See Also

build.intercepts, and highway.assign for obtaining the results of a select link analysis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Not run: 
# Select links 17 and 24
select.links <- ( network$Links$.LinkID 

# but only if the trips originate in zones 1,3 and 5, and end up in zones 12:24
zone.pairs <- data.matrix(expand.grid(c(1,3,5),c(12:24)))
select.matrix <- matrix(0,nrow=network$numZones,ncol=network$numZones)
select.matrix[zone.pairs] <- 1
select.od <- function(od) { od * select.matrix }

# build an intercept set using these specifications
iset <- new.intercept.set( select.links, select.od )

# use in the highway assignment algorithm
assignment.results <- highway.assign( aset, method="Frank.Wolfe", control=list(intercept=iset) )

# or use directly with build.intercept.function (for example, if creating a new assignment algorithm)

#    First, create a service function (a do-nothing placeholder if iset is not set)
build.intercepts <- build.intercept.function(iset,aset)

#    Then find some paths (free flow in this case)
paths <- build.paths(aset,aset$ff.flow)

#    Then apply the function
intercept <- build.intercepts(paths)

# the intercept result contains a list of matrices (element "od") with the selected demand for each class, and
# a data.frame (element "volumes) of selected volumes.

## End(Not run)

travelr documentation built on May 2, 2019, 5:17 p.m.