[PEAK] trellis attrs
nicky van foreest
vanforeest at gmail.com
Fri Sep 30 16:16:41 EDT 2011
> They will actually work together. If you do what I said, then you can also
> pass in a specific set as Lloyd suggests... there's just no need to unless
> you want to use a specific set instead of having a empty default set
> created.
Ok. Thanks.
Sorry to bug you, but I tried also the following:
class Step(trellis.Component):
duration = trellis.attr(0)
def __init__(self, machine):
self.machine = machine
self.prevs = trellis.Set([])
instead of
class Step(trellis.Component):
prevs = trellis.make(trellis.Set)
duration = trellis.attr(0)
def __init__(self, machine):
self.machine = machine
This also works (that is, I get the same schedule in both cases). Is
there a difference between the two implementations? The second
implementation sets prevs as a class variable, but this does not
appear necessary (telling from implementation 1).
Nicky
More information about the PEAK
mailing list