end
until nc == 0
+ for _, nnm in pairs(self.modules) do
+ assert(distance[nnm], 'Some modules are not connected to inputs')
+ end
+
self.sorted = {}
for m, d in pairs(distance) do
table.insert(self.sorted, { distance = d, nnm = m })
self:nestedApply(
function(nnm)
if #self.node[nnm].succ == 0 then
- error('Input modules must have outgoing edges.')
+ error('Input modules must have outgoing edges.')
end
if #self.node[nnm].pred > 0 then
error('Input modules cannot have incoming edges.')