Changes between Version 10 and Version 11 of NetworkDynamicConverterFunctions


Ignore:
Timestamp:
10/18/12 14:34:27 (7 years ago)
Author:
skyebend
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NetworkDynamicConverterFunctions

    v10 v11  
    8686 
    8787 
    88 ==== behavior sketch ==== 
     88==== behavior sketch and implementation notes==== 
     89 
     90Validate inputs 
     91 start <= end 
     92 base.net is NULL or a network  
     93 if not NULL coerce toggles, spells, changes to matrix, test for minimum number of columns 
     94 network.list is NULL or all elements of list are networks.  
     95 if network sizes of network.list items vary, vertex.pid must be non-NULL 
     96 if vertex.pid != NULL, it must be present in network vertex attributes 
     97 onsets and termini must be NULL or numeric, the same length and the same length as network.list 
     98 construct.mode is valid 
     99 only one of vertex.toggles, vertex.spells and vertex.changes can be non-NULL 
     100 only one of edge.toggles, edge.spells and edge.changes can be non-NULL 
     101 if network.list is non-NULL vertex.* and edge.* must be NULL and the reverse 
     102 
    89103 
    90104Determines if building from network list, as that specifies both edge and vertex dynamics at the same time 
     
    92106  If base.net is specified, constructs a new network with matching parameters.  If vertex or edges or attributes are present, adds them to new network as non-TEA attributes? 
    93107 
    94   Determined if all the networks in the list are the same size. If not, checks for vertex.pid parameter to specify which vertex attribute should be used as a unique identifier. 
     108  Determines if all the networks in the list are the same size. If not, checks for vertex.pid parameter to specify which vertex attribute should be used as a unique identifier. 
    95109  In onsets is not set, it defaults to seq(from=0,length=length(network.list)). If terminus not set defaults to seq(from=1,length=length(network.list)) 
    96110 
    97   Step through the list of networks, adding the set of edges and vertices to the new network with onset and terminus times specified by onsets and termini vectors.  If inconsistencies are encountered, perform as indicated by construct.mode.  Add any network, vertex, or edge attributes found in the list networks to nD as TEA with appropriate spells.  
     111  Steps through the list of networks, adding the set of edges and vertices to the new network with onset and terminus times specified by onsets and termini vectors.  If inconsistencies are encountered, perform as indicated by construct.mode.  Add any network, vertex, or edge attributes found in the list networks to nD as TEA with appropriate spells.  
    98112 
    99113 
    100114If not building from network list: 
    101  
    102 Determine vertex data schema.  If more than one of toggles, spells and changes specified, give error.  
    103  
    104 Determine edge data schema.  If more than one of toggles, spells and changes specified, give error.  
    105  
    106 set start and end censoring on observation attribute.  
    107  
    108 If nothing specified, return error, otherwise return constructed network dynamic.  
     115   
     116   
     117  If base.net exists determine if the set of vertex.ids is consistent with base net 
     118  Create new network with properties given by base net if present 
     119   
     120   
     121  Determine vertex data schema. 
     122  If toggles 
     123    activate all vertices present in base net, assuming onset time of -Inf 
     124    loop through toggles, activating and deactivating vertices at appropriate times. vertices where last toggle is to active given Inf as terminus.  
     125  If changes 
     126    activate all vertices present in base net, assuming onset time of -Inf 
     127    can convert directly to activation, deactivation lists and apply to vertices in a single pass. vertices where last change is to active given Inf as terminus 
     128  If spells 
     129    apply activation spells to vertices 
     130   
     131Determine edge data schema. 
     132 
     133If base.net exists, determine if the set of vertex.ids present in the edges data is consistent with it and take action appropriate to construct.mode    
     134 
     135  If toggles 
     136    Add all edges present in base.net 
     137    Set initial edge state according to base net, assuming -Inf as onset. 
     138    Add all additional edges implied by toggles  
     139    loop through toggles, activating and deactivating edges at appropriate times. All edges where last state is active given Inf as terminus. (Look at pavel's code to see how he did it.)  
     140 
     141  If changes 
     142    Add all edges present in base.net 
     143    Set initial edge state according to base net, assuming -Inf as onset. 
     144    Add all additional edges implied by toggles  
     145    loop through changes, activating and deactivating edges at appropriate times. All edges where last state is active given Inf as terminus  
     146  If spells 
     147     
     148 
     149set start and end censoring on nD observation attribute.  
     150 
     151return constructed networkDynamic.  
    109152 
    110153 
     
    114157 
    115158==== Edge cases to consider ==== 
    116 edge activity not consistent with vertex activity 
    117 network list: base net size different than list net sizes 
    118 base net has multiplex edges? 
     159 
     160toggles, changes arguments present, but have zero rows: base.net state applied to entire network, respecting start and end if present. if no base.net, no spells added activity status will be determined by active.default argument during query 
     161 
     162spells  arguments present, but have zero rows: no spells added, activity status will be determined by active.default argument during query 
     163 
     164network list: base.net size different than list net sizes 
     165 
     166base net has multiplex edges? Not sure how to interpret for toggles, changes and spells. Activate all matching edges? 
     167 
     168network.list has networks with multiplex edges or edges with multiple vertex head- tail-sets. (I think this will work if we write code correctly) 
     169 
     170if all arguments empty, should return empty network, but still no way to specify that.  
     171 
     172edge activity not consistent with vertex activity (edge active when incident vertex is not) : behavior determined by construct.mode 
    119173 
    120174==== Notes / Questions ==== 
    121 If we want to support multiplex edges, need to expand toggles etc to allow specifying an persistent eid 
     175 
     176Should additional columns present on toggls, spells, changes be added as TEA attributes? 
     177 
     178There is existing code for many of these steps, but it is fragmented across many hidden methods, needs to be organized and recycled where possible.  
     179 
     180If we want to support multiplex edges, need to expand toggles etc to allow specifying a persistent eid 
     181 
    122182Not sure how we would support multiple vertex head- and tail-sets on edges, vertex pid? 
    123 What if base.net is a nD object, should we try to append to it? 
     183 
     184What if base.net is a nD object, should we try to append to it? If so, need a way to determine the last state of network for toggles and edges.  
     185 
     186What if vertices/edges need to be inactive at the start of observation in toggles case? Include First toggle at 0  
     187 
     188If vertex activity is specified, should vertices implied by network size that are never activated be removed? 
     189 
     190 
     191==== Proposed vertex.pid behavior ==== 
     192how to handle alpha ids and convert them in a stable way to vertex.ids .  See pid spec.  
     193 
    124194 
    125195=== Exporting from nD ===