self.inputModules = i
self:applyOnModules(
function(m)
- if (not self.succ[m] or #self.succ[m] == 0) or (self.pred[m] and #self.pred[m] > 0) then
- error('Invalid input edges.')
+ if not self.succ[m] or #self.succ[m] == 0 then
+ error('Input modules must have outgoing edges.')
+ end
+ if self.pred[m] and #self.pred[m] > 0 then
+ error('Input modules cannog have incoming edges.')
end
end,
self.inputModules
self.outputModules = o
self:applyOnModules(
function(m)
- if (not self.pred[m] or #self.pred[m] == 0) or (self.succ[m] and #self.succ[m] > 0) then
- error('Invalid output edges.')
+ if not self.pred[m] or #self.pred[m] == 0 then
+ error('Output module must have incoming edges.')
+ end
+ if self.succ[m] and #self.succ[m] > 0 then
+ error('Output module cannot have outgoing edges.')
end
end,
self.outputModules