pub enum Error {
Show 17 variants
ConnectionAlreadyExists {
source: usize,
target: usize,
},
ConnectionMissingSource,
ConnectionMissingTarget,
ConnectionSourceAndTargetSameDepth {
depth: DepthType,
},
ConnectionSourceAndTargetAreSame,
ConnectionSourceDeeperThanTarget {
source: DepthType,
target: DepthType,
},
GenomeMissingNodes,
GenomeWithoutInputNodes,
GenomeWithoutOutputNodes,
GenomeMissingConnections,
GenomeMaxNodesReached,
GenomeMaxConnectionsReached,
GenomeIsTooShallow,
LayerMustHaveMoreThanOneNode,
LayerInputLengthMismatch {
expected: usize,
got: usize,
},
LayerDoesNotExist,
UnhandledError {
text: String,
},
}Expand description
A collection of errors that Perestroika can generate.
Variants§
ConnectionAlreadyExists
Raised when trying to create a Connection which already exists in a Genome.
ConnectionMissingSource
Raised when a Connection is missing a source Node.
ConnectionMissingTarget
Raised when a Connection is missing a target Node.
ConnectionSourceAndTargetSameDepth
Raised when a Connection has the soure and target Nodes are on the same depth.
ConnectionSourceAndTargetAreSame
A more specific version of ConnectionSourceAndTargetSameDepth.
ConnectionSourceDeeperThanTarget
Raised when a Connection has a source Node deeper than the target Node.
Fields
GenomeMissingNodes
Raised when a Genome is created without Nodes.
A Genome must have at least two Layers, an Input and Output, on each at least a single Node.
GenomeWithoutInputNodes
Raised when a Genome is created without Input Nodes.
GenomeWithoutOutputNodes
Raised when a Genome is created without Output Nodes.
GenomeMissingConnections
Raised if an operation on a Genome requires Connections, but the Genome has none.
GenomeMaxNodesReached
Raised when an operation on a Genome tries to create a new Node, but the Genome has the maximum amount of Nodes.
GenomeMaxConnectionsReached
Raised when an operation on a Genome tries to create a new Connection, but the Genome has the maximum amount of Connections.
GenomeIsTooShallow
Raised when an operation on the Genome tries to access a hidden layer, but there are none.
LayerMustHaveMoreThanOneNode
Raised when an operation on a Genome requires a removal of a Node from a Layer, but the Layer has a single Node.
LayerInputLengthMismatch
Raised when a Genome tries to propagate the inputs but the input’s length differs from the input Layer’s length.
Fields
LayerDoesNotExist
Raised when a Layer that does not exist is being used or called.
UnhandledError
An error that currently does not have a dedicated name.