do
return _name
end
- attr _name: String
+ attr _name: String = null
end
class WakeUpNode
do
_scheduler.add_event(self, d)
end
- attr _scheduler: Scheduler
+ attr _scheduler: Scheduler = null
end
class NodeSource
special Node
- attr _nexts: ArraySet[NodeSink]
+ attr _nexts: ArraySet[NodeSink] = null
meth attach(n: NodeSink)
# Add the sink `n' the the connected nodes
# Do nothing if `n' is already connected
class Scheduler
attr _time_list: Array[Couple[Int, WakeUpNode]]
- attr _time: Int # What time is it ?
+ attr _time: Int = 0 # What time is it ?
meth add_event(n: WakeUpNode, d: Int)
# The node `n' whant to be weaked up in `d' time units
do
class CountSink
special NodeSink
- readable attr _count: Int
+ readable attr _count: Int = 0
redef meth recieve(n: NodeSource)
do
_count = _count + 1