The layer/network classes have a lot of diverging code paths because the behaviours of these classes is expected to be different when being used to specify the problem vs when executing. This should be solved by separating these uses into their own classes.