Running ‘activate_tests.R’ [0s/0s]
Running the tests in ‘tests/activate_tests.R’ failed.
Complete output:
  > #  Part of the statnet package, http://statnetproject.org
  > #
  > #  This software is distributed under the GPL-3 license.  It is free,
  > #  open source, and has the attribution requirements (GPL Section 7) in
  > #    http://statnetproject.org/attribution
  > #
  > #  Copyright 2013 the statnet development team
  > ######################################################################
  > 
  > 
  > ########################################################################
  > # This file contains the testing suite for the "activate" methods, i.e.:
  > #      activate.edges        deactivate.edges
  > #      activate.vertices     deactivate.vertices     
  > #########################################################################
  > 
  > require(networkDynamic)
  Loading required package: networkDynamic
  Loading required package: network
  network: Classes for Relational Data
  Version 1.13.0 created on 2015-08-31.
  copyright (c) 2005, Carter T. Butts, University of California-Irvine
                      Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Martina Morris, University of Washington
                      Skye Bender-deMoll, University of Washington
   For citation information, type citation("network").
   Type help("network-package") to get started.
  
  
  networkDynamic: version 0.9.0, created on 2016-01-12
  Copyright (c) 2016, Carter T. Butts, University of California -- Irvine
                      Ayn Leslie-Cook, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Skye Bender-deMoll, University of Washington
                      with contributions from
                      Zack Almquist, University of California -- Irvine
                      David R. Hunter, Penn State University
                      Li Wang
                      Kirk Li, University of Washington
                      Steven M. Goodreau, University of Washington
                      Jeffrey Horner
                      Martina Morris, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("networkDynamic").
  
  > require(testthat)
  Loading required package: testthat
  > 
  > 
  > #------------------- ACTIVATE.EDGES TESTS ------------------------
  > # Notes:
  > #  --except for the error-checking code, the rest of the tests
  > #    are meant to be exhaustive
  > #-----------------------------------------------------------------
  > 
  > cat("testing activate.edges ... ")
  testing activate.edges ... > anet <- network.initialize(100)
  > set.seed(10)
  > heads <- sample(100, 150, replace=TRUE)
  > set.seed(25)
  > tails <- sample(100, 150, replace=TRUE)
  > add.edges(anet, tails, heads)
  > anet.copy <- anet
  > 
  > # proper behavior for bad inputs?
  > #  -- bad network input
  > a1 = try(activate.edges(3, e=1), T)                    # properly handeled
  > #  -- bad at times
  > a2 = try(activate.edges(anet, at="a", e=2), T)         # properly handeled
  > #  -- bad onset
  > a3 = try(activate.edges(anet, "a", e=3), T)            # properly handeled
  > a4 = try(activate.edges(anet, NULL, 3, e=4), T)        # properly handeled
  > # -- bad terminus
  > a5 = try(activate.edges(anet, 3, "b", e=5), T)         # properly handeled
  > # -- bad length
  > a6 = try(activate.edges(anet, 3, length=-9, e=6), T)   # properly handeled
  > a7 = try(activate.edges(anet, 3, length="r", e=7), T)  # properly handeled
  > # -- bad edges
  > a8 = try(activate.edges(anet, 3, 10, e=174), T)        # properly handeled
  > a9 = try(activate.edges(anet, 3, 10, e=-2), T)         # properly handeled
  > a10 = try(activate.edges(anet, 3, 10, e=NULL), T)      # properly handeled
  > a11 = try(activate.edges(anet, 3, 10, e="hello"), T)   # properly handeled
  > # -- bad onset & terminus combo
  > a12 = try(activate.edges(anet, 10, 3, e=8), T)         # properly handeled
  > # -- not fully specified intervals
  > a13 = try(activate.edges(anet, 10, e=9), T)            # properly handeled
  > a14 = try(activate.edges(anet, terminus=10, e=10), T)  # properly handeled
  > a15 = try(activate.edges(anet, length=10, e=11), T)    # properly handeled
  > 
  > 
  > # good input
  > anet <- anet.copy
  > # for edges lacking an active attribute
  > activate.edges(anet, Inf, Inf, e=1)         # add (Inf, Inf) spell
  > b1 = is.null(anet$mel[[1]]$atl$active)
  > activate.edges(anet, -Inf, -Inf, e=2)       # add (-Inf, -Inf) spell
  > b2 = is.null(anet$mel[[2]]$atl$active)
  > activate.edges(anet, -Inf, Inf, e=3)        # add (-Inf, Inf) spell
  > b3 = identical(anet$mel[[3]]$atl$active,
  +               matrix(c(-Inf, Inf), 1,2))
  > activate.edges(anet, -Inf, Inf, e=4)        # add (-Inf, Inf) spell
  > b4 = identical(anet$mel[[4]]$atl$active,
  +               matrix(c(-Inf, Inf), 1,2))
  > activate.edges(anet, -Inf, 10,  e=5)        # add (-Inf, b) spell
  > b5 = identical(anet$mel[[5]]$atl$active,
  +               matrix(c(-Inf, 10), 1,2))
  > activate.edges(anet, 0, Inf, e=6)           # add (a, Inf) spell
  > b6 = identical(anet$mel[[6]]$atl$active,
  +               matrix(c(0, Inf), 1,2))
  > activate.edges(anet, -10, Inf, e=7)         # add (a, Inf) spell
  > b7 = identical(anet$mel[[7]]$atl$active,
  +               matrix(c(-10, Inf), 1,2))
  > activate.edges(anet, 10, 20, e=8)           # add (a, b) spell
  > b8 = identical(anet$mel[[8]]$atl$active,
  +               matrix(c(10, 20), 1,2))
  > activate.edges(anet, 10, 10, e=9)           # add (a, a) spell
  > b8 = identical(anet$mel[[9]]$atl$active,
  +               matrix(c(10, 10), 1,2))
  > 
  > b.tests = paste("b", seq(1,8), sep="")
  > b.results= sapply(b.tests, function(x){eval(parse(text=x))})
  > if(any(!b.results)){
  +   bad.tests = paste("b", which(!b.results), sep="", collapse=" ")
  +   stop(paste("activate.edges is incorrectly activating edges in tests",
  +              bad.tests))
  + }
  > 
  > 
  > # for edges already having an active attribute
  > anet <- anet.copy
  > 
  > # Notes:
  > #    - a, b are upper, lower boundary points
  > #    - L is a finite number lower than a
  > #    - M is a finite number in between a and b
  > #    - H is a finite number higher than b
  > #    -Gij is a finite number that is in the gap b/t intervals i and j
  > 
  > # tests for activation at a point
  > for (i in 1:3)
  +   anet$mel[[i]]$atl$active <- matrix(c(Inf,Inf), 1,2)
  > for (i in 4:6)
  +   anet$mel[[i]]$atl$active <- matrix(c(-Inf,-Inf), 1,2)
  > activate.edges(anet, -Inf,  Inf, e=7:9)
  > activate.edges(anet, -Inf,   20, e=10:13)
  > activate.edges(anet,   10,  Inf, e=14:17)
  > activate.edges(anet,   10,   20, e=18:24)
  > activate.edges(anet,   10,   10, e=25:26)
  > 
  > activate.edges(anet, at=c(-Inf, Inf, 0, -Inf, Inf,  0, -Inf, Inf,  0, -Inf, 20,   0, 30, Inf, 10, 30,  0, -Inf, Inf, 10, 20, 15, 30,  0, 10, 20),
  +                     e = c(   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))  
  > c1  = identical(anet$mel[[1]]$atl$active,      # add -Inf to  (Inf, Inf)
  +       matrix(c(Inf, Inf),1,2))    
  > c2  = identical(anet$mel[[2]]$atl$active,      # add Inf  to  (Inf, Inf)
  +       matrix(c(Inf, Inf),1,2))    
  > c3  = identical(anet$mel[[3]]$atl$active,      # add M    to  (Inf, Inf)
  +       matrix(c(0, 0),1,2))  
  > c4  = identical(anet$mel[[4]]$atl$active,      # add -Inf to  (-Inf, -Inf)
  +       matrix(c(-Inf, -Inf),1,2))    
  > c5  = identical(anet$mel[[5]]$atl$active,      # add Inf  to  (-Inf, -Inf)
  +       matrix(c(-Inf, -Inf),1,2))    
  > c6  = identical(anet$mel[[6]]$atl$active,      # add M    to  (-Inf, -Inf)
  +       matrix(c(0, 0),1,2))    
  > c7  = identical(anet$mel[[7]]$atl$active,      # add -Inf to  (-Inf, Inf)
  +       matrix(c(-Inf, Inf),1,2))    
  > c8  = identical(anet$mel[[8]]$atl$active,      # add Inf  to  (-Inf, Inf)
  +       matrix(c(-Inf, Inf),1,2))    
  > c9  = identical(anet$mel[[9]]$atl$active,      # add M    to  (-Inf, Inf)
  +       matrix(c(-Inf, Inf),1,2))    
  > c10 = identical(anet$mel[[10]]$atl$active,     # add -Inf to  (-Inf, b)
  +       matrix(c(-Inf, 20),1,2))      
  > c11 = identical(anet$mel[[11]]$atl$active,     # add b    to  (-Inf, b)
  +       matrix(c(-Inf,20,20,20),2,2))    
  > c12 = identical(anet$mel[[12]]$atl$active,     # add M    to  (-Inf, b)
  +       matrix(c(-Inf, 20),1,2))    
  > c13 = identical(anet$mel[[13]]$atl$active,     # add H    to  (-Inf, b)
  +       matrix(c(-Inf,30,20,30),2,2))      
  > c14 = identical(anet$mel[[14]]$atl$active,     # add Inf  to  (a, Inf)
  +       matrix(c(10, Inf),1,2))    
  > c15 = identical(anet$mel[[15]]$atl$active,     # add a    to  (a, Inf)
  +       matrix(c(10, Inf),1,2))    
  > c16 = identical(anet$mel[[16]]$atl$active,     # add M    to  (a, Inf)
  +       matrix(c(10, Inf),1,2))    
  > c17 = identical(anet$mel[[17]]$atl$active,     # add L    to  (a, Inf)
  +       matrix(c(0,10,0,Inf),2,2))    
  > c18 = identical(anet$mel[[18]]$atl$active,     # add -Inf to  (a,b)
  +       matrix(c(10,20),1,2))    
  > c19 = identical(anet$mel[[19]]$atl$active,     # add Inf  to  (a,b)
  +       matrix(c(10, 20),1,2))    
  > c20 = identical(anet$mel[[20]]$atl$active,     # add a    to  (a,b)
  +       matrix(c(10,20),1,2))    
  > c21 = identical(anet$mel[[21]]$atl$active,     # add b    to  (a,b)
  +       matrix(c(10,20,20,20),2,2))    
  > c22 = identical(anet$mel[[22]]$atl$active,     # add M    to  (a,b)
  +       matrix(c(10, 20),1,2))    
  > c23 = identical(anet$mel[[23]]$atl$active,     # add H    to  (a,b)
  +       matrix(c(10,30,20,30),2,2))    
  > c24 = identical(anet$mel[[24]]$atl$active,     # add L    to  (a,b)    
  +       matrix(c(0,10,0,20),2,2))  
  > c25 = identical(anet$mel[[25]]$atl$active,     # add a    to  (a,a)    
  +       matrix(c(10,10),1,2))  
  > c26 = identical(anet$mel[[26]]$atl$active,     # add H    to  (a,a)    
  +       matrix(c(10,20,10,20),2,2))  
  >   
  > c.tests = paste("c", seq(1,26), sep="")
  > c.results= sapply(c.tests, function(x){eval(parse(text=x))})
  > if(any(!c.results)){
  +   bad.tests = paste("c", which(!c.results), sep="", collapse=" ")
  +   stop(paste("activate.edges is incorrectly activating edges in tests",
  +              bad.tests))
  + }
  > 
  > 
  > anet <- anet.copy
  > for (i in 1:7)
  +   anet$mel[[i]]$atl$active <- matrix(c(Inf,Inf), 1,2)
  > activate.edges(anet, c(Inf, -Inf, -Inf, -Inf,  10, 10, 10),
  +                      c(Inf, -Inf,  Inf,   10, Inf, 20, 10),
  +                  e = c(  1,    2,    3,    4,   5,  6,  7))
  > d1  = identical(anet$mel[[1]]$atl$active,   # add (Inf, Inf)   to (Inf, Inf) spell
  +       matrix(c(Inf, Inf), 1,2))
  > d2  = identical(anet$mel[[2]]$atl$active,   # add (-Inf, -Inf) to (Inf, Inf) spell
  +       matrix(c(Inf, Inf), 1,2))
  > d3  = identical(anet$mel[[3]]$atl$active,   # add (-Inf, Inf)  to (Inf, Inf) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d4  = identical(anet$mel[[4]]$atl$active,   # add (-Inf, b)    to (Inf, Inf) spell
  +       matrix(c(-Inf, 10), 1,2))
  > d5  = identical(anet$mel[[5]]$atl$active,   # add (a, Inf)     to (Inf, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d6  = identical(anet$mel[[6]]$atl$active,   # add (a, b)       to (Inf, Inf) spell
  +       matrix(c(10, 20), 1,2))
  > d7  = identical(anet$mel[[7]]$atl$active,   # add (a, a)       to (Inf, Inf) spell
  +       matrix(c(10, 10), 1,2))
  > 
  > 
  > for (i in 8:14)
  +   anet$mel[[i]]$atl$active <- matrix(c(-Inf, -Inf), 1,2)
  > activate.edges(anet, c(Inf, -Inf, -Inf, -Inf,  10, 10, 20),
  +                      c(Inf, -Inf,  Inf,   10, Inf, 20, 20),
  +                  e = c(  8,    9,   10,  11,   12, 13, 14))
  > d8  = identical(anet$mel[[8]]$atl$active,   # add (Inf, Inf)   to (-Inf, -Inf) spell
  +       matrix(c(-Inf, -Inf), 1,2))
  > d9  = identical(anet$mel[[9]]$atl$active,   # add (-Inf, -Inf) to (-Inf, -Inf) spell
  +       matrix(c(-Inf, -Inf), 1,2))
  > d10  = identical(anet$mel[[10]]$atl$active, # add (-Inf, Inf)  to (-Inf, -Inf) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d11 = identical(anet$mel[[11]]$atl$active,  # add (-Inf, H)    to (-Inf, -Inf) spell
  +       matrix(c(-Inf, 10), 1,2))
  > d12 = identical(anet$mel[[12]]$atl$active,  # add (H, Inf)     to (-Inf, -Inf) spell
  +       matrix(c(10,  Inf), 1,2, byrow=T))
  > d13 = identical(anet$mel[[13]]$atl$active,  # add (H1, H2)       to -(Inf, -Inf) spell
  +       matrix(c(10,  20), 1,2, byrow=T))
  > d14 = identical(anet$mel[[14]]$atl$active,  # add (H1, H1)       to -(Inf, -Inf) spell
  +       matrix(c(20,  20), 1,2, byrow=T))
  > 
  > 
  > activate.edges(anet, -Inf, 10, e=seq(15,32))
  > activate.edges(anet, c(Inf, -Inf, -Inf, -Inf, -Inf, -Inf,   0,  10,  20,  0, 10, 10,  0, -5,  0, 20, 20, 10),
  +                      c(Inf, -Inf,  Inf,    0,   10,   20, Inf, Inf, Inf, 10, 10, 20,  0,  0, 20, 30, 20, 10),
  +                  e = c( 15,   16,   17,   18,   19,   20,  21,  22,  23, 24, 25, 26, 27, 28, 29, 30, 31, 32))
  > d15 = identical(anet$mel[[15]]$atl$active,   # add (Inf, Inf)   to (-Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2))
  > d16 = identical(anet$mel[[16]]$atl$active,   # add (-Inf, -Inf) to (-Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2))
  > d17 = identical(anet$mel[[17]]$atl$active,   # add (-Inf, Inf)  to (-Inf, b) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d18 = identical(anet$mel[[18]]$atl$active,   # add (-Inf, M)    to (-Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2))
  > d19 = identical(anet$mel[[19]]$atl$active,   # add (-Inf, b)    to (-Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2)) 
  > d20 = identical(anet$mel[[20]]$atl$active,   # add (-Inf, H)    to (-Inf, b) spell
  +       matrix(c(-Inf, 20), 1,2))
  > d21 = identical(anet$mel[[21]]$atl$active,   # add (M, Inf)     to (-Inf, b) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d22 = identical(anet$mel[[22]]$atl$active,   # add (b, Inf)     to (-Inf, b) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d23 = identical(anet$mel[[23]]$atl$active,   # add (H, Inf)     to (-Inf, b) spell
  +       matrix(c(-Inf,20,10,Inf),2,2))
  > d24 = identical(anet$mel[[24]]$atl$active,   # add (M, b)       to (-Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2))
  > d25 = identical(anet$mel[[25]]$atl$active,   # add (b, b)       to (-Inf, b) spell
  +       matrix(c(-Inf, 10,10,10), 2,2))
  > d26 = identical(anet$mel[[26]]$atl$active,   # add (b, H)       to (-Inf, b) spell
  +       matrix(c(-Inf, 20), 1,2))
  > d27 = identical(anet$mel[[27]]$atl$active,   # add (M, M)       to -(Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2))  
  > d28 = identical(anet$mel[[28]]$atl$active,   # add (M1, M2)     to -(Inf, b) spell
  +       matrix(c(-Inf, 10), 1,2))    
  > d29 = identical(anet$mel[[29]]$atl$active,   # add (M, H)       to -(Inf, b) spell
  +       matrix(c(-Inf, 20), 1,2))  
  > d30 = identical(anet$mel[[30]]$atl$active,   # add (H1, H2)     to -(Inf, b) spell
  +       matrix(c(-Inf,20,10,30),2,2))
  > d31 = identical(anet$mel[[31]]$atl$active,   # add (H, H)       to -(Inf, b) spell
  +       matrix(c(-Inf,20,10,20),2,2))
  > d32 = identical(anet$mel[[32]]$atl$active,   # add (b, b)       to -(Inf, b) spell
  +       matrix(c(-Inf,10,10,10),2,2))
  > 
  > 
  > activate.edges(anet, 10, Inf, e=seq(33,49))
  > activate.edges(anet, c(Inf, -Inf, -Inf, -Inf, -Inf, -Inf,   0,  10,  20,  0, 10, 10,  0, -5, 20,  0, 20),
  +                      c(Inf, -Inf,  Inf,    0,   10,   20, Inf, Inf, Inf, 10, 10, 20,  5, 20, 30,  0, 20),
  +                  e = c( 33,   34,   35,   36,   37,   38,  39,  40,  41, 42, 43, 44, 45, 46, 47, 48, 49))
  > d33 = identical(anet$mel[[33]]$atl$active,   # add (Inf, Inf)   to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d34 = identical(anet$mel[[34]]$atl$active,   # add (-Inf, -Inf) to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d35 = identical(anet$mel[[35]]$atl$active,   # add (-Inf, Inf)  to (a, Inf) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d36 = identical(anet$mel[[36]]$atl$active,   # add (-Inf, L)    to (a, Inf) spell
  +       matrix(c(-Inf,10,0,Inf),2,2))
  > d37 = identical(anet$mel[[37]]$atl$active,   # add (-Inf, a)    to (a, Inf) spell
  +       matrix(c(-Inf, Inf), 1,2)) 
  > d38 = identical(anet$mel[[38]]$atl$active,   # add (-Inf, M)    to (a, Inf) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d39 = identical(anet$mel[[39]]$atl$active,   # add (L, Inf)     to (a, Inf) spell
  +       matrix(c(0, Inf), 1,2))
  > d40 = identical(anet$mel[[40]]$atl$active,   # add (a, Inf)     to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d41 = identical(anet$mel[[41]]$atl$active,   # add (M, Inf)     to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d42 = identical(anet$mel[[42]]$atl$active,   # add (L, a)       to (a, Inf) spell
  +       matrix(c(0, Inf), 1,2))
  > d43 = identical(anet$mel[[43]]$atl$active,   # add (a, a)       to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d44 = identical(anet$mel[[44]]$atl$active,   # add (a, M)       to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d45 = identical(anet$mel[[45]]$atl$active,   # add (L1, L2)     to (a, Inf) spell
  +       matrix(c(0,10,5,Inf),2,2))
  > d46 = identical(anet$mel[[46]]$atl$active,   # add (L, M)       to (a, Inf) spell
  +       matrix(c(-5, Inf), 1,2))    
  > d47 = identical(anet$mel[[47]]$atl$active,   # add (M1, M2)     to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > d48 = identical(anet$mel[[48]]$atl$active,   # add (L, L)       to (a, Inf) spell
  +       matrix(c(0,10,0,Inf), 2,2))
  > d49 = identical(anet$mel[[49]]$atl$active,   # add (H, H)       to (a, Inf) spell
  +       matrix(c(10, Inf), 1,2))
  > 
  > 
  > activate.edges(anet, 10, 20, e=seq(50,76))
  > activate.edges(anet, c(Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf,   0,  10,  15,  20,  30,  0, 10, 10, 10, 10,  0, 20, 20, -5,  0,  0, 12, 15, 30),
  +                      c(Inf, -Inf,  Inf,    0,   10,   15,   20,   30, Inf, Inf, Inf, Inf, Inf, 10, 10, 15, 20, 30, 20, 20, 30,  0, 15, 30, 15, 30, 40),
  +                  e = c( 50,   51,   52,   53,   54,   55,   56,   57,  58,  59,  60,  61,  62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76))
  > d50 = identical(anet$mel[[50]]$atl$active,   # add (Inf, Inf)   to (a, b) spell
  +       matrix(c(10,20), 1,2))
  > d51 = identical(anet$mel[[51]]$atl$active,   # add (-Inf, -Inf) to (a, b) spell
  +       matrix(c(10,20), 1,2))  
  > d52 = identical(anet$mel[[52]]$atl$active,   # add (-Inf, Inf)  to (a, b) spell
  +       matrix(c(-Inf, Inf), 1,2))
  > d53 = identical(anet$mel[[53]]$atl$active,   # add (-Inf, L)    to (a, b) spell
  +       matrix(c(-Inf,10,0,20),2,2))
  > d54 = identical(anet$mel[[54]]$atl$active,   # add (-Inf, a)    to (a, b) spell
  +       matrix(c(-Inf, 20), 1,2)) 
  > d55 = identical(anet$mel[[55]]$atl$active,   # add (-Inf, M)    to (a, b) spell
  +       matrix(c(-Inf, 20), 1,2))
  > d56 = identical(anet$mel[[56]]$atl$active,   # add (-Inf, b)    to (a, b) spell
  +       matrix(c(-Inf, 20), 1,2)) 
  > d57 = identical(anet$mel[[57]]$atl$active,   # add (-Inf, H)    to (a, b) spell
  +       matrix(c(-Inf, 30), 1,2))
  > d58 = identical(anet$mel[[58]]$atl$active,   # add (L, Inf)     to (a, b) spell
  +       matrix(c(0, Inf), 1,2))
  > d59 = identical(anet$mel[[59]]$atl$active,   # add (a, Inf)     to (a, b) spell
  +       matrix(c(10, Inf), 1,2))
  > d60 = identical(anet$mel[[60]]$atl$active,   # add (M, Inf)     to (a, b) spell
  +       matrix(c(10, Inf), 1,2))
  > d61 = identical(anet$mel[[61]]$atl$active,   # add (b, Inf)     to (a, b) spell
  +       matrix(c(10, Inf), 1,2))
  > d62 = identical(anet$mel[[62]]$atl$active,   # add (H, Inf)     to (a, b) spell
  +       matrix(c(10,30,20,Inf),2,2))
  > d63 = identical(anet$mel[[63]]$atl$active,   # add (L, a)       to (a, b) spell
  +       matrix(c(0, 20), 1,2))
  > d64 = identical(anet$mel[[64]]$atl$active,   # add (a, a)       to (a, b) spell
  +       matrix(c(10, 20), 1,2))
  > d65 = identical(anet$mel[[65]]$atl$active,   # add (a, M)       to (a, b) spell
  +       matrix(c(10, 20), 1,2))
  > d66 = identical(anet$mel[[66]]$atl$active,   # add (a, b)       to (a, b) spell
  +       matrix(c(10, 20), 1,2))
  > d67 = identical(anet$mel[[67]]$atl$active,   # add (a, H)       to (a, b) spell
  +       matrix(c(10, 30), 1,2))
  > d68 = identical(anet$mel[[68]]$atl$active,   # add (L, b)       to (a, b) spell
  +       matrix(c(0, 20), 1,2))
  > d69 = identical(anet$mel[[69]]$atl$active,   # add (b, b)       to (a, b) spell
  +       matrix(c(10, 20,20,20), 2,2))
  > d70 = identical(anet$mel[[70]]$atl$active,   # add (b, H)       to (a, b) spell
  +       matrix(c(10, 30), 1,2))
  > d71 = identical(anet$mel[[71]]$atl$active,   # add (L1, L2)     to (a, b) spell
  +       matrix(c(-5,10,0,20),2,2))
  > d72 = identical(anet$mel[[72]]$atl$active,   # add (L, M)       to (a, b) spell
  +       matrix(c(0, 20), 1,2))    
  > d73 = identical(anet$mel[[73]]$atl$active,   # add (L, H)       to (a, b) spell
  +       matrix(c(0, 30), 1,2))    
  > d74 = identical(anet$mel[[74]]$atl$active,   # add (M1, M2)     to (a, b) spell
  +       matrix(c(10, 20), 1,2))
  > d75 = identical(anet$mel[[75]]$atl$active,   # add (M, H)       to (a, b) spell
  +       matrix(c(10, 30), 1,2))    
  > d76 = identical(anet$mel[[76]]$atl$active,   # add (H1, H2)     to (a, b) spell
  +       matrix(c(10,30,20,40),2,2))
  > 
  > activate.edges(anet, -Inf,  10, e=seq(77, 100))
  > activate.edges(anet,   20,  30, e=seq(77, 100))
  > activate.edges(anet,   30,  30, e=seq(77, 100))
  > activate.edges(anet,   40,  50, e=seq(77, 100))
  > activate.edges(anet,   60, Inf, e=seq(77, 100))
  > activate.edges(anet, c(Inf, -Inf, -Inf, -Inf, -Inf, -Inf, -Inf,  20,  25,  30,  35, 20, 20, 20, 30, 20, 30, 30, 30, 15, 15, 15,  0,   0),
  +                      c(Inf,  Inf,   20,   25,   30,   35,   55, Inf, Inf, Inf, Inf, 40, 45, 50, 35, 55, 40, 45, 55, 35, 45, 55, 25,  55),
  +                  e = c( 77,   78,   79,   80,   81,   82,   83,  84,  85,  86,  87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100))
  > dmat0 = matrix(c(-Inf,20,30,40,60,10,30,30,50,Inf),5,2)
  > dmat1 = matrix(c(-Inf,30,40,60,30,30,50,Inf),4,2)
  > dmat2 = matrix(c(-Inf,40,60,35,50,Inf),3,2)
  > dmat3 = matrix(c(-Inf,20,60,10,55,Inf),3,2)
  > dmat4 = matrix(c(-Inf,20,10,Inf),2,2)
  > dmat5 = matrix(c(-Inf,20,30,35,10,30,30,Inf),4,2)
  > dmat6 = matrix(c(-Inf,20,60,10,50,Inf),3,2)
  > dmat7 = matrix(c(-Inf,20,60,10,55,Inf),3,2)
  > dmat8 = matrix(c(-Inf,15,40,60,10,35,50,Inf),4,2)
  > dmat9 = matrix(c(-Inf,15,60,10,50,Inf),3,2)
  > dmat10 = matrix(c(-Inf,15,60,10,55,Inf),3,2)
  > dmat11 = matrix(c(-Inf,20,40,60,10,35,50,Inf),4,2)
  > dmat12 = matrix(c(-Inf,60,55,Inf),2,2)
  > 
  > d77 = identical(anet$mel[[77]]$atl$active, dmat0)    # add (Inf, Inf)   to set of spells
  > d78 = identical(anet$mel[[78]]$atl$active,           # add (-Inf, Inf)  to set of spells
  +       matrix(c(-Inf, Inf), 1,2))
  > d79 = identical(anet$mel[[79]]$atl$active, dmat1)    # add (-Inf, a2)   to set of spells
  > d80 = identical(anet$mel[[80]]$atl$active, dmat1)    # add (-Inf, M2)   to set of spells
  > d81 = identical(anet$mel[[81]]$atl$active, dmat1)    # add (-Inf, b2)   to set of spells
  > d82 = identical(anet$mel[[82]]$atl$active, dmat2)    # add (-Inf, G23)  to set of spells
  > d83 = identical(anet$mel[[83]]$atl$active, dmat12)   # add (-Inf, G34)  to set of spells
  > d84 = identical(anet$mel[[84]]$atl$active, dmat4)    # add (a2, Inf)    to set of spells
  > d85 = identical(anet$mel[[85]]$atl$active, dmat4)    # add (M2, Inf)    to set of spells
  > d86 = identical(anet$mel[[86]]$atl$active, dmat4)    # add (b2, Inf)    to set of spells
  > d87 = identical(anet$mel[[87]]$atl$active, dmat5)    # add (G23, Inf)   to set of spells
  > d88 = identical(anet$mel[[88]]$atl$active, dmat6)    # add (a2, a3)     to set of spells
  > d89 = identical(anet$mel[[89]]$atl$active, dmat6)    # add (a2, M3)     to set of spells
  > d90 = identical(anet$mel[[90]]$atl$active, dmat6)    # add (a2, b3)     to set of spells
  > d91 = identical(anet$mel[[91]]$atl$active, dmat11)   # add (a2, G23)    to set of spells
  > d92 = identical(anet$mel[[92]]$atl$active, dmat3)    # add (a2, G34)    to set of spells
  > d93 = identical(anet$mel[[93]]$atl$active, dmat6)    # add (b2, a3)     to set of spells
  > d94 = identical(anet$mel[[94]]$atl$active, dmat6)    # add (b2, M3)     to set of spells
  > d95 = identical(anet$mel[[95]]$atl$active, dmat7)    # add (b2, G34)    to set of spells
  > d96 = identical(anet$mel[[96]]$atl$active, dmat8)    # add (G12, G23)   to set of spells
  > d97 = identical(anet$mel[[97]]$atl$active, dmat9)    # add (G12, M3)    to set of spells
  > d98 = identical(anet$mel[[98]]$atl$active, dmat10)   # add (G12, G34)   to set of spells
  > d99 = identical(anet$mel[[99]]$atl$active, dmat1)    # add (M1, M2)     to set of spells
  > d100 = identical(anet$mel[[100]]$atl$active, dmat12) # add (M1, G34)    to set of spells
  > 
  >                
  > d.tests = paste("d", seq(1,94), sep="")
  > d.results= sapply(d.tests, function(x){eval(parse(text=x))})
  > if(any(!d.results)){
  +   bad.tests = paste("d", which(!d.results), sep="", collapse=" ")
  +   stop(paste("activate.edges is incorrectly activating edges in tests",
  +              bad.tests))
  + }
  > 
  > 
  > # other tests for 'activate.edges'
  > anet <- anet.copy
  > mat0=matrix(c(-Inf, Inf),1,2)
  > # default behavior
  > activate.edges(anet, e=1)                     # no inputs, no activity matrix
  > e1 = identical(anet$mel[[1]]$atl$active,mat0)
  > activate.edges(anet, 3, 10, e=2)               # no inputs, activity matrix
  > activate.edges(anet, e=2)                     
  > e2 = identical(anet$mel[[2]]$atl$active,mat0)
  > anet$mel[[3]]$atl$active <- matrix(c(Inf,Inf), 1,2) # no inputs, matrix of null spell
  > activate.edges(anet, e=3) 
  > e3 = identical(anet$mel[[3]]$atl$active,mat0)
  > #activate.edges(anet, e=2, onset=3)            # only onset
  > #e2 = identical(anet$mel[[2]]$atl$active,
  > #  matrix(c(3, Inf),1,2))
  > #activate.edges(anet, e=3, terminus=3)         # only terminus
  > #e3 = identical(anet$mel[[3]]$atl$active,
  > #  matrix(c(-Inf, 3),1,2))
  > # ignoring 'null' spells
  > activate.edges(anet, Inf, Inf, e=4)          # single call (Inf, Inf)
  > e4 = is.null(anet$mel[[4]]$atl$active)
  > activate.edges(anet, -Inf, -Inf, e=5)        # single call (-Inf, -Inf)
  > e5 = is.null(anet$mel[[5]]$atl$active)
  > activate.edges(anet, c(-Inf, -Inf, -Inf,  3, Inf), # mixed call, even lengths
  +                      c( Inf, -Inf,  10, Inf, Inf),
  +                      e=seq(6,10))
  > e6 = is.null(anet$mel[[7]]$atl$active) &
  +      is.null(anet$mel[[10]]$atl$active)
  > activate.edges(anet, c(-Inf, -Inf, Inf),     # mixed call, uneven lengths
  +                      c( Inf, -Inf),
  +                      e=seq(11,14))
  > e7 = identical(anet$mel[[11]]$atl$active,
  +         matrix(c(-Inf, Inf),1,2)) &&
  +      is.null(anet$mel[[12]]$atl$active) &&
  +      is.null(anet$mel[[13]]$atl$active) &&
  +      is.null(anet$mel[[14]]$atl$active)
  > 
  > e.tests = paste("e", seq(1,7), sep="")
  > e.results= sapply(e.tests, function(x){eval(parse(text=x))})
  > if(any(!e.results)){
  +   bad.tests = paste("e", which(!e.results), sep="", collapse=" ")
  +   stop(paste("activate.edges is incorrectly activating edges in tests",
  +              bad.tests))
  + }
  > # using 'at' rather than 'onset' and 'terminus'
  > activate.edges(anet, -Inf,  10, e=seq(15, 24))
  > activate.edges(anet,   20,  30, e=seq(15, 24))
  > activate.edges(anet,   40, Inf, e=seq(15, 24))
  > activate.edges(anet, c(Inf, -Inf, 20, 30, 25), c(Inf, -Inf, 20, 30, 25), e=15:19)
  > activate.edges(anet, at=c(Inf, -Inf, 20, 30, 25), e=20:24)
  > f1 = identical(anet$mel[[15]]$atl$active, anet$mel[[20]]$atl$active)
  > f2 = identical(anet$mel[[16]]$atl$active, anet$mel[[21]]$atl$active)
  > f3 = identical(anet$mel[[17]]$atl$active, anet$mel[[22]]$atl$active)
  > f4 = identical(anet$mel[[18]]$atl$active, anet$mel[[23]]$atl$active)
  > f5 = identical(anet$mel[[19]]$atl$active, anet$mel[[24]]$atl$active)
  > # or 'length' rather than 'terminus'
  > activate.edges(anet, -Inf,  10, e=seq(25, 43))
  > activate.edges(anet,   20,  30, e=seq(25, 43))
  > activate.edges(anet,   40, Inf, e=seq(25, 43))
  > activate.edges(anet, c(15, 15, 15, 15, 15, 20, 20, 20, 20),
  +                      c(18, 20, 25, 30, 35, 25, 30, 35, 40),
  +                    e=c(25, 26, 27, 28, 29, 30, 31, 32, 33))
  > activate.edges(anet, c(15, 15, 15, 15, 15, 20, 20, 20, 20),
  +              length =c( 3,  5, 10, 15, 20,  5, 10, 15, 20),
  +                   e =c(35, 36, 37, 38, 39, 40, 41, 42, 43))
  > f6  = identical(anet$mel[[25]]$atl$active, anet$mel[[35]]$atl$active)
  > f7  = identical(anet$mel[[26]]$atl$active, anet$mel[[36]]$atl$active)
  > f8  = identical(anet$mel[[27]]$atl$active, anet$mel[[37]]$atl$active)
  > f9  = identical(anet$mel[[28]]$atl$active, anet$mel[[38]]$atl$active)
  > f10 = identical(anet$mel[[29]]$atl$active, anet$mel[[39]]$atl$active)
  > f11 = identical(anet$mel[[30]]$atl$active, anet$mel[[40]]$atl$active)
  > f12 = identical(anet$mel[[31]]$atl$active, anet$mel[[41]]$atl$active)
  > f13 = identical(anet$mel[[32]]$atl$active, anet$mel[[42]]$atl$active)
  > f14 = identical(anet$mel[[33]]$atl$active, anet$mel[[43]]$atl$active)
  > # possible oddities around inclusion of instantaneous points
  > activate.edges(anet, 10, 20, e=44:48)
  > activate.edges(anet, at=20, e=44:48)
  > activate.edges(anet, at=30, e=46:48)
  > activate.edges(anet, at=10, e=49:50)
  > activate.edges(anet, at=20, e=49:50)
  > activate.edges(anet, at=30, e=50)
  >                
  > activate.edges(anet, 20, 30, e=44)
  > f15 = identical(anet$mel[[44]]$atl$active,
  +         matrix(c(10, 30),1,2))
  > activate.edges(anet, 15, 30, e=45)
  > f16 = identical(anet$mel[[45]]$atl$active,
  +         matrix(c(10, 30),1,2))
  > activate.edges(anet, 20, 30, e=46)
  > f17 = identical(anet$mel[[46]]$atl$active,
  +         matrix(c(10,30,30,30),2,2))
  > activate.edges(anet, 20, 40, e=47)
  > f18 = identical(anet$mel[[47]]$atl$active,
  +         matrix(c(10, 40),1,2))
  > activate.edges(anet, 30, 40, e=48)
  > f19 = identical(anet$mel[[48]]$atl$active,
  +         matrix(c(10,20,30,20,20,40),3,2))
  > activate.edges(anet, 20,20, e=49)
  > f20 = identical(anet$mel[[49]]$atl$active,
  +         matrix(c(10,20,10,20),2,2))
  > activate.edges(anet, 20,20, e=50)               
  > f21 = identical(anet$mel[[50]]$atl$active,
  +         matrix(c(10,20,30,10,20,30),3,2))
  >                
  > f.tests = paste("f", seq(1,21), sep="")
  > f.results= sapply(f.tests, function(x){eval(parse(text=x))})
  > if(any(!f.results)){
  +   bad.tests = paste("f", which(!f.results), sep="", collapse=" ")
  +   stop(paste("activate.edges is incorrectly activating edges in tests",
  +              bad.tests))
  + }
  > 
  > # no edges, so should do nothing (but not crash)
  > expect_equal(network.edgecount(activate.edges(network.initialize(0))),0)
  > 
  > # test activate multiple spells for same edge
  > test<-network.initialize(3)
  > test[1,2]<-1
  Error in test[1, 2] <- 1 : incorrect number of subscripts on matrix
  Execution halted