get.edge.start {dynamicnetwork}R Documentation

read or modify the times assigned to an exisiting edge

Description

convinience methods for reading or modifying edge times without directly accessing the list, makes it possible to change implementation in the future.

Usage

get.edge.start(network, edgeID)
get.edge.end(network, edgeID)
set.edge.start(network,edgeID,valid.time)
set.edge.end(network,edgeID,valid.time)

Arguments

network network the network the edge belongs to
edgeID edgeID the ID of the edge
valid.time edgeID (for setters) the start (or end) value for the edge

Details

These methods make it possible to access and modify the valid intervals associated with edges. It is much preferable to use these methods instead of directly modifing the objects. For dynamic network objects the edge timing information is stored on a list named 'et' (edge time list) that parallels the master edge list. The timing information for an edge will be at the same index on tel as the edge index on mel.

Value

get methods will return a single numeric value indicating either the starting time or ending time of the edge. 'NA' can also be used to indicate that it is unknown or undefined.
set methods will return the network object containing the newly modified edge

Note

the ETL list is not backended in C, so it is important to be careful with the network objects returned

Author(s)

Skye Bender-deMoll skyebend@skyeome.net

Examples


  #make a network
   myNet <- network.initialize(5);
  #add some edges
    myNet[1,2] <-1;
    myNet[2,3] <-1;
    myNet[2,4] <-1;
    myNet[3,5] <-1;
    #convert it to dynamic, will have the bounds [0,1]
    myDyn <- as.dynamic(myNet);
    #check the end of the first edge
    get.edge.end(myDyn,1);
    #check the start of the 2nd edge
    get.edge.start(myDyn,2);
    #change the first edge
    myDyn <- set.edge.start(myDyn, 1, 2); #whoops, we made an invalid interval [2,1] !
    myDyn <- set.edge.end(myDyn,1,5);
    #print the etl to see if it worked
    print(myDyn$etl);
    #plot the valid intervals
    plot.intervals(myDyn);
   

[Package dynamicnetwork version 0.0-4 Index]