changeset 299:6931479b657a

Make attic, move a bunch of old files to it
author David McClosky <dmcc@bigasterisk.com>
date Mon, 20 Jun 2005 18:52:21 +0000
parents d0f29e247af4
children 71050b87f208
files DataTypes/NextTime.py DataTypes/dmx.py DataTypes/dmxlevel.py NodeInstance.py NodeType.py Nodes/delay.py Nodes/dmxout.py Nodes/gamma.py Nodes/sine.py Op.py Port.py StateManager.py attic/DataTypes/NextTime.py attic/DataTypes/dmx.py attic/DataTypes/dmxlevel.py attic/NodeInstance.py attic/NodeType.py attic/Nodes/delay.py attic/Nodes/dmxout.py attic/Nodes/gamma.py attic/Nodes/sine.py attic/Op.py attic/Port.py attic/README attic/StateManager.py nodes/delay.py nodes/gamma.py nodes/sine.py
diffstat 28 files changed, 350 insertions(+), 415 deletions(-) [+]
line wrap: on
line diff
--- a/DataTypes/NextTime.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-'''Baby, there won't be no next time'''
-
-class NextTime:
-    def __init__(self, nextclock, interval=None)
-        self.nextclock = nextclock
-        self.interval = interval
-    def cylic(self):
-        return interval is not None
--- a/DataTypes/dmx.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-
-class DMX(list):
-    """the signal that goes on a real-life dmx wire. it's up to 512
-    un-named channels each with a 8-bit value on each channel. this type
-    is useful for a DMXOut node or DMXLevelDisplay node. the channels are
-    stored in a python list where the first channel is at index 0. the
-    first channel in dmx terminology would be called channel 1."""
-    
-    def __init__(self,dmxlevels):
-        if len(dmxlevels)>512:
-            raise TypeError("DMX objects can't have more than 512 channels")
-        list.extend(dmxlevels) # list.__init__ did't work right
-
-    def append(self,level):
-        if len(self)==512:
-            raise TypeError("DMX objects can't have more than 512 channels")
-        list.append(self,level)
-
-    def extend(self,levels):
-        if len(self)+len(levels)>512:
-            raise TypeError("DMX objects can't have more than 512 channels")
-        list.extend(self,levels)
-
-    def __setslice__(self,i,j,seq):
-        newlength = len(self)-(max(0,j)-max(0,i))+len(seq)
-        # we could check if newlength>512, but any length-changing slice is
-        # probably wrong for this datatype
-        if newlength!=len(self):
-            raise NotImplementedError("Different-length setslice would disturb DMX channels")
-        list.__setslice__(self,i,j,seq)
-        
--- a/DataTypes/dmxlevel.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-###
-
-"""
-Snippet 0x93.2b: example of outputting a special type
-
-class DMXLevel(float):
-  def __init__(self,f):
-    self.value = min(max(0,f),255)
-  ...
-  def __get__(...) # maybe
-
-output.dmxlevel = DMXLevel(300)
-    
->>> print output.dmxlevel
-    255
-
-dmxlevel = DMXLevel(3)
-dmxlevel += 800
-d = d + 800
-
-There's yer problem:
-http://python.org/doc/current/ref/numeric-types.html#l2h-152
-
-"""
--- a/NodeInstance.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-'''Internal class for StateManager'''
-
-# warning: pseduocode
-class NodeInstance:
-    ip_addr?
-    get_this_nodes_url()
-
-    type = the node type (a subclass of Node)
-        ops (get from type)
-    input,output = the ports that are created for the node instance
-    state = associated state
--- a/NodeType.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-"""each node descends from this base class"""
-
-class NodeType:
-    def __init__(self):
-        """TBD"""
-        self.ops = Ops()
-
-        ''' maybe
-        self.iports = []
-        self.oports = []
-        self.params = []
-        '''
-    def get_state(self, stateaccess):
-        """This is similar to the pickle.__getstate__ method, except
-        we need this alternate version in order to give the node
-        (which holds no state) access to its instance's state.
-
-        If your node keeps some transient items in its state dict
-        (such as a buffer of recently received inputs), it may want to
-        return a copy of the state dict without those items. set_state
-        should restore them properly (if they're missing from the
-        current state, which they might not be).
-
-        get_state might be called at any time, and it's certainly not
-        guaranteed that the node instance is going out of service.
-        get_state might get called to checkpoint the nodes for a
-        backup, for example. set_state might also get called anytime.
-        """
-        return stateaccess
-    def set_state(self, stateaccess, dict):
-        """dict (named after the pickle.__setstate__ argument) is
-        always a value that was previously returned from
-        get_state. Don't adjust the current nodetype's state, of course;
-        use dict to update stateaccess.  If there were elements
-        missing from dict (see the note in get_state for why this
-        might be the case), you should restore them here as
-        appropriate.
-        """        
-        stateaccess.update(dict)
-    def get_default_params(self):
-        '''Returns dictionary of param names and DataType instances.  DataTypes 
-        can be given values'''
-        return {}
-    def get_default_ports(self):
-        '''Returns pinless port objects'''
-        return {}
--- a/Nodes/delay.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-"""delay node outputs the input a fixed time later"""
-
-
-class DelayOps(Ops):
-    def clocked(self, input, output, stateaccess):
-        stateaccess.buffer
-
-
-class Delay(Node):
-    def __init__(self):
-        Node.__init__(self)
-        
-    def getnodeparams(self):
-        return {'delay':State.Time}
--- a/Nodes/dmxout.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-
-
-class ops(Ops):
-    def changed(self, input, output, stateaccess):
-        input.dmx
-    
-class DMXOut(Node):
-    def get_default_ports(self):
-        return {'dmx':InputPort(DMX,required=1,maxpins=1)}
-    def get_default_params(self):
-        return {'outputrefresh':NextTime,'outputdevice':DMXDevice}
--- a/Nodes/gamma.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-"""node that performs a simple gamma (exp) function on its input"""
-
-class GammaOps(Ops):
-    def started(self, input, output, stateaccess):
-        self.startmeup(stateaccess)
-    def changed(self, input, output, stateaccess):
-        port.output = port.input ** stateaccess.gamma + stateaccess.offset
-        stateaccess.lastvalue = State.FloatingPoint(port.input)
-
-        output = gamma(input)
-    # no timed function
-    def startmeup(self, stateaccess):
-        # whatever
-        pass
-
-class Gamma(Node):
-    def __init__(self):
-        Node.__init__(self)
-        self.node_params = {'gamma':State.FloatingPoint,'offset':State.FloatingPoint}
-        self.ops = GammaOps()
-
-    def getnodeparams(self):
-        return self.node_params
-        
-    def getports(self):
-        return (Port('a', optional=1),
-                Port('b'))
-
-    def __str__(self):
-        return "3"
-
-world.register_node(Gamma)
--- a/Nodes/sine.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-"""node that generates a sine wave"""
-
-
-class SineGenerator(Node):
-    def op(self, input, output, stateaccess):
-
-        # input and output have names
-        output.sin = stateaccess.magnitude * math.sin(stateaccess.phase+input.time)
-
-        """
-        # dict-style access for names with spaces
-        output['sin'] = input['ti me']
-        # underscore magic for accessing names with spaces-- the port object makes
-        # this work
-        output.sin=input.ti_me
-
-        input.time = input.money
-        """
-
-    def getports(self):
-        return OutputPort('sin'), InputPort('time'), InputPort('money')
--- a/Op.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-"""each node type has an Op within it"""
-
-class Op:
-    """nodes can have several versions of their operation function.
-
-    ops don't return anything! 
-    """
-    def __init__(self):
-        """This should not be overridden without being called."""
-        pass
-
-    def inputschanged(self, input, output, stateaccess):
-        """If you only define one op function body, make it this one. """
-        pass
-    
-    def created(self, input, output, stateaccess):
-        """This is called one time when the node is newly created. It's
-        not called when the node instance is pickled/unpickled. Use this
-        version to initialize state."""
-        # an extra call to changed() should help the outputs get set
-        # correctly before any real inputs-changed events come around
-        # (assuming this method doesn't get overridden with a
-        # specialized version)
-        self.inputschanged(input, output, stateaccess)        
-
-    def statechanged(self, input, output, stateaccess):
-        '''State might have been changed by a user dragging a parameter or by
-        a state being hcanged otherwise.'''
-        self.inputschanged(input, output, stateaccess)        
-
-    def clocked(self, input, output, stateaccess):
-        self.inputschanged(input, output, stateaccess)        
--- a/Port.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-from nodetypes import DiscoType
-
-ANY = -1
-
-class Port:
-    def __setattr__(self, key, value):
-        '''Alias for __setitem___'''
-        self[key] = value
-    def __setitem__(self, key, value):
-        pass
-    def __getattr__(self, key):
-        '''Alias for __getitem___'''
-        return self[key]
-    def __getitem__(self, key):
-        pass
-
-class InputPort(Port):
-    def __init__(self, allowedtype, required=1, maxpins=ANY):
-        self.pins = []
-
-class OutputPort(Port):
-    def __init__(self):
-        self.pins = []
-
-class Pin:
-    def __init__(self, connection, value=DiscoType):
-        pass
-
-'''
-Snippet Pi=3: RFC 2: New port semantics
-
-# an example of the max node's op
-def changed(self, inputs):
-    # note how this function does not use stateaccess, as it doesn't use state
-    return max(inputs.values())
-
-# so, how the heck does this work?
-# we check the function to get the names of kw args in the function.
-# we always pass self, but everything else is optional
-# the node asked for inputs, which looks like this:
-# inputs = {'portname' : PortObj, 'portname2', PortObj}
-# somehow, the PortObjs are max'ible.
-# the node has only one output so it can just return the value to set the 
-# output.  (maybe)
-# alteratively, if we decide that you always return a new dict of outputs:
-# return {'outputportname' : max(inputs.values())}
-# which isn't horrible, but not great
-
-# another example: an adder.  the node has ports A and B, and an output C:
-# C also gets capped at stateaccess[min].
-def changed(self, a, b, c, stateaccess):
-    c.set(max(stateaccess['min'], a + b))
-    return {}
-
-# or:
-def changed(self, a, b, stateaccess):
-    c = max(stateaccess['min'], a + b)
-    return {'c' : c}
-
-# which i think is clearer.  doing all port changes at the end has some
-# book-keeping advantages (we can detect easily which ports are changed)
-# the counter node could work this way:
-
-def changed(self, someoutput):
-    return {'someoutput' : someoutput + 1}
-'''
-
-'''
-type 1: a, b, d, e
-type 2: b, c, d, f
-
-conversion maps:
-a -> [ ]
-b -> b
-d -> d
-e -> f
-'''
--- a/StateManager.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-''' Database of NodeInstances, part of the Core '''
-
-# this will be hard to write until NodeInstances are written, but I'll try
-# anyway
-
-__version__ = "$Id: StateManager.py,v 1.1 2002/07/04 00:21:35 drewp Exp $"
-
-class StateManager:
-    '''StateManager is the second of the core to be built.  It should be 
-       after the network, then the scheduler.
-
-       After StateManager is constructed, you probably want to do load_state().
-       All of the above is taken care of by the Core module.
-       
-       Also, in general, 'name' indicates the name of a node, in NRL
-       (like URL) syntax:
-       node:group/innergroup/node
-
-       or
-
-       node:node
-
-       if node is in the top level group (the root, or universe, or whatever
-        you want to call it
-    '''
-    def __init__(self, network):
-        '''Sets up some dicts, maybe'''
-        # need some storage locations, etc.
-        self.network = network
-    def save_state(self):
-        '''Save state to disk'''
-        pass
-    def load_state(self):
-        '''Load state from disk'''
-        pass
-    def get_input_names(self, name):
-        '''Get the names of the nodes which are inputs to a node'''
-        pass
-    def get_output_names(self, name):
-        '''Get the names of the nodes which are outputs to a node'''
-        pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/DataTypes/NextTime.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,8 @@
+'''Baby, there won't be no next time'''
+
+class NextTime:
+    def __init__(self, nextclock, interval=None)
+        self.nextclock = nextclock
+        self.interval = interval
+    def cylic(self):
+        return interval is not None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/DataTypes/dmx.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,31 @@
+
+class DMX(list):
+    """the signal that goes on a real-life dmx wire. it's up to 512
+    un-named channels each with a 8-bit value on each channel. this type
+    is useful for a DMXOut node or DMXLevelDisplay node. the channels are
+    stored in a python list where the first channel is at index 0. the
+    first channel in dmx terminology would be called channel 1."""
+    
+    def __init__(self,dmxlevels):
+        if len(dmxlevels)>512:
+            raise TypeError("DMX objects can't have more than 512 channels")
+        list.extend(dmxlevels) # list.__init__ did't work right
+
+    def append(self,level):
+        if len(self)==512:
+            raise TypeError("DMX objects can't have more than 512 channels")
+        list.append(self,level)
+
+    def extend(self,levels):
+        if len(self)+len(levels)>512:
+            raise TypeError("DMX objects can't have more than 512 channels")
+        list.extend(self,levels)
+
+    def __setslice__(self,i,j,seq):
+        newlength = len(self)-(max(0,j)-max(0,i))+len(seq)
+        # we could check if newlength>512, but any length-changing slice is
+        # probably wrong for this datatype
+        if newlength!=len(self):
+            raise NotImplementedError("Different-length setslice would disturb DMX channels")
+        list.__setslice__(self,i,j,seq)
+        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/DataTypes/dmxlevel.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,24 @@
+###
+
+"""
+Snippet 0x93.2b: example of outputting a special type
+
+class DMXLevel(float):
+  def __init__(self,f):
+    self.value = min(max(0,f),255)
+  ...
+  def __get__(...) # maybe
+
+output.dmxlevel = DMXLevel(300)
+    
+>>> print output.dmxlevel
+    255
+
+dmxlevel = DMXLevel(3)
+dmxlevel += 800
+d = d + 800
+
+There's yer problem:
+http://python.org/doc/current/ref/numeric-types.html#l2h-152
+
+"""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/NodeInstance.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,11 @@
+'''Internal class for StateManager'''
+
+# warning: pseduocode
+class NodeInstance:
+    ip_addr?
+    get_this_nodes_url()
+
+    type = the node type (a subclass of Node)
+        ops (get from type)
+    input,output = the ports that are created for the node instance
+    state = associated state
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/NodeType.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,46 @@
+"""each node descends from this base class"""
+
+class NodeType:
+    def __init__(self):
+        """TBD"""
+        self.ops = Ops()
+
+        ''' maybe
+        self.iports = []
+        self.oports = []
+        self.params = []
+        '''
+    def get_state(self, stateaccess):
+        """This is similar to the pickle.__getstate__ method, except
+        we need this alternate version in order to give the node
+        (which holds no state) access to its instance's state.
+
+        If your node keeps some transient items in its state dict
+        (such as a buffer of recently received inputs), it may want to
+        return a copy of the state dict without those items. set_state
+        should restore them properly (if they're missing from the
+        current state, which they might not be).
+
+        get_state might be called at any time, and it's certainly not
+        guaranteed that the node instance is going out of service.
+        get_state might get called to checkpoint the nodes for a
+        backup, for example. set_state might also get called anytime.
+        """
+        return stateaccess
+    def set_state(self, stateaccess, dict):
+        """dict (named after the pickle.__setstate__ argument) is
+        always a value that was previously returned from
+        get_state. Don't adjust the current nodetype's state, of course;
+        use dict to update stateaccess.  If there were elements
+        missing from dict (see the note in get_state for why this
+        might be the case), you should restore them here as
+        appropriate.
+        """        
+        stateaccess.update(dict)
+    def get_default_params(self):
+        '''Returns dictionary of param names and DataType instances.  DataTypes 
+        can be given values'''
+        return {}
+    def get_default_ports(self):
+        '''Returns pinless port objects'''
+        return {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/Nodes/delay.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,14 @@
+"""delay node outputs the input a fixed time later"""
+
+
+class DelayOps(Ops):
+    def clocked(self, input, output, stateaccess):
+        stateaccess.buffer
+
+
+class Delay(Node):
+    def __init__(self):
+        Node.__init__(self)
+        
+    def getnodeparams(self):
+        return {'delay':State.Time}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/Nodes/dmxout.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,11 @@
+
+
+class ops(Ops):
+    def changed(self, input, output, stateaccess):
+        input.dmx
+    
+class DMXOut(Node):
+    def get_default_ports(self):
+        return {'dmx':InputPort(DMX,required=1,maxpins=1)}
+    def get_default_params(self):
+        return {'outputrefresh':NextTime,'outputdevice':DMXDevice}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/Nodes/gamma.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,32 @@
+"""node that performs a simple gamma (exp) function on its input"""
+
+class GammaOps(Ops):
+    def started(self, input, output, stateaccess):
+        self.startmeup(stateaccess)
+    def changed(self, input, output, stateaccess):
+        port.output = port.input ** stateaccess.gamma + stateaccess.offset
+        stateaccess.lastvalue = State.FloatingPoint(port.input)
+
+        output = gamma(input)
+    # no timed function
+    def startmeup(self, stateaccess):
+        # whatever
+        pass
+
+class Gamma(Node):
+    def __init__(self):
+        Node.__init__(self)
+        self.node_params = {'gamma':State.FloatingPoint,'offset':State.FloatingPoint}
+        self.ops = GammaOps()
+
+    def getnodeparams(self):
+        return self.node_params
+        
+    def getports(self):
+        return (Port('a', optional=1),
+                Port('b'))
+
+    def __str__(self):
+        return "3"
+
+world.register_node(Gamma)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/Nodes/sine.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,21 @@
+"""node that generates a sine wave"""
+
+
+class SineGenerator(Node):
+    def op(self, input, output, stateaccess):
+
+        # input and output have names
+        output.sin = stateaccess.magnitude * math.sin(stateaccess.phase+input.time)
+
+        """
+        # dict-style access for names with spaces
+        output['sin'] = input['ti me']
+        # underscore magic for accessing names with spaces-- the port object makes
+        # this work
+        output.sin=input.ti_me
+
+        input.time = input.money
+        """
+
+    def getports(self):
+        return OutputPort('sin'), InputPort('time'), InputPort('money')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/Op.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,32 @@
+"""each node type has an Op within it"""
+
+class Op:
+    """nodes can have several versions of their operation function.
+
+    ops don't return anything! 
+    """
+    def __init__(self):
+        """This should not be overridden without being called."""
+        pass
+
+    def inputschanged(self, input, output, stateaccess):
+        """If you only define one op function body, make it this one. """
+        pass
+    
+    def created(self, input, output, stateaccess):
+        """This is called one time when the node is newly created. It's
+        not called when the node instance is pickled/unpickled. Use this
+        version to initialize state."""
+        # an extra call to changed() should help the outputs get set
+        # correctly before any real inputs-changed events come around
+        # (assuming this method doesn't get overridden with a
+        # specialized version)
+        self.inputschanged(input, output, stateaccess)        
+
+    def statechanged(self, input, output, stateaccess):
+        '''State might have been changed by a user dragging a parameter or by
+        a state being hcanged otherwise.'''
+        self.inputschanged(input, output, stateaccess)        
+
+    def clocked(self, input, output, stateaccess):
+        self.inputschanged(input, output, stateaccess)        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/Port.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,77 @@
+from nodetypes import DiscoType
+
+ANY = -1
+
+class Port:
+    def __setattr__(self, key, value):
+        '''Alias for __setitem___'''
+        self[key] = value
+    def __setitem__(self, key, value):
+        pass
+    def __getattr__(self, key):
+        '''Alias for __getitem___'''
+        return self[key]
+    def __getitem__(self, key):
+        pass
+
+class InputPort(Port):
+    def __init__(self, allowedtype, required=1, maxpins=ANY):
+        self.pins = []
+
+class OutputPort(Port):
+    def __init__(self):
+        self.pins = []
+
+class Pin:
+    def __init__(self, connection, value=DiscoType):
+        pass
+
+'''
+Snippet Pi=3: RFC 2: New port semantics
+
+# an example of the max node's op
+def changed(self, inputs):
+    # note how this function does not use stateaccess, as it doesn't use state
+    return max(inputs.values())
+
+# so, how the heck does this work?
+# we check the function to get the names of kw args in the function.
+# we always pass self, but everything else is optional
+# the node asked for inputs, which looks like this:
+# inputs = {'portname' : PortObj, 'portname2', PortObj}
+# somehow, the PortObjs are max'ible.
+# the node has only one output so it can just return the value to set the 
+# output.  (maybe)
+# alteratively, if we decide that you always return a new dict of outputs:
+# return {'outputportname' : max(inputs.values())}
+# which isn't horrible, but not great
+
+# another example: an adder.  the node has ports A and B, and an output C:
+# C also gets capped at stateaccess[min].
+def changed(self, a, b, c, stateaccess):
+    c.set(max(stateaccess['min'], a + b))
+    return {}
+
+# or:
+def changed(self, a, b, stateaccess):
+    c = max(stateaccess['min'], a + b)
+    return {'c' : c}
+
+# which i think is clearer.  doing all port changes at the end has some
+# book-keeping advantages (we can detect easily which ports are changed)
+# the counter node could work this way:
+
+def changed(self, someoutput):
+    return {'someoutput' : someoutput + 1}
+'''
+
+'''
+type 1: a, b, d, e
+type 2: b, c, d, f
+
+conversion maps:
+a -> [ ]
+b -> b
+d -> d
+e -> f
+'''
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/README	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,2 @@
+This is old code from various years, attempting to brainstorm models.
+Many of the ideas in them are very outdated.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/attic/StateManager.py	Mon Jun 20 18:52:21 2005 +0000
@@ -0,0 +1,41 @@
+''' Database of NodeInstances, part of the Core '''
+
+# this will be hard to write until NodeInstances are written, but I'll try
+# anyway
+
+__version__ = "$Id: StateManager.py,v 1.1 2002/07/04 00:21:35 drewp Exp $"
+
+class StateManager:
+    '''StateManager is the second of the core to be built.  It should be 
+       after the network, then the scheduler.
+
+       After StateManager is constructed, you probably want to do load_state().
+       All of the above is taken care of by the Core module.
+       
+       Also, in general, 'name' indicates the name of a node, in NRL
+       (like URL) syntax:
+       node:group/innergroup/node
+
+       or
+
+       node:node
+
+       if node is in the top level group (the root, or universe, or whatever
+        you want to call it
+    '''
+    def __init__(self, network):
+        '''Sets up some dicts, maybe'''
+        # need some storage locations, etc.
+        self.network = network
+    def save_state(self):
+        '''Save state to disk'''
+        pass
+    def load_state(self):
+        '''Load state from disk'''
+        pass
+    def get_input_names(self, name):
+        '''Get the names of the nodes which are inputs to a node'''
+        pass
+    def get_output_names(self, name):
+        '''Get the names of the nodes which are outputs to a node'''
+        pass
--- a/nodes/delay.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-"""delay node outputs the input a fixed time later"""
-
-
-class DelayOps(Ops):
-    def clocked(self, input, output, stateaccess):
-        stateaccess.buffer
-
-
-class Delay(Node):
-    def __init__(self):
-        Node.__init__(self)
-        
-    def getnodeparams(self):
-        return {'delay':State.Time}
--- a/nodes/gamma.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-"""node that performs a simple gamma (exp) function on its input"""
-
-class GammaOps(Ops):
-    def started(self, input, output, stateaccess):
-        self.startmeup(stateaccess)
-    def changed(self, input, output, stateaccess):
-        port.output = port.input ** stateaccess.gamma + stateaccess.offset
-        stateaccess.lastvalue = State.FloatingPoint(port.input)
-
-        output = gamma(input)
-    # no timed function
-    def startmeup(self, stateaccess):
-        # whatever
-        pass
-
-class Gamma(Node):
-    def __init__(self):
-        Node.__init__(self)
-        self.node_params = {'gamma':State.FloatingPoint,'offset':State.FloatingPoint}
-        self.ops = GammaOps()
-
-    def getnodeparams(self):
-        return self.node_params
-        
-    def getports(self):
-        return (Port('a', optional=1),
-                Port('b'))
-
-    def __str__(self):
-        return "3"
-
-world.register_node(Gamma)
--- a/nodes/sine.py	Mon Jun 20 08:43:35 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-"""node that generates a sine wave"""
-
-
-class SineGenerator(Node):
-    def op(self, input, output, stateaccess):
-
-        # input and output have names
-        output.sin = stateaccess.magnitude * math.sin(stateaccess.phase+input.time)
-
-        """
-        # dict-style access for names with spaces
-        output['sin'] = input['ti me']
-        # underscore magic for accessing names with spaces-- the port object makes
-        # this work
-        output.sin=input.ti_me
-
-        input.time = input.money
-        """
-
-    def getports(self):
-        return OutputPort('sin'), InputPort('time'), InputPort('money')