use thiserror::Error;
#[derive(Error, Debug, Clone, PartialEq)]
pub enum SynapseError {
#[error("Invalid synaptic weight: {0}. Expected value in range [{1}, {2}]")]
InvalidWeight(f64, f64, f64),
#[error("Invalid time constant: {0}. Must be positive")]
InvalidTimeConstant(f64),
#[error("Invalid delay: {0}. Must be non-negative")]
InvalidDelay(f64),
#[error("Invalid probability: {0}. Must be in range [0, 1]")]
InvalidProbability(f64),
#[error("Invalid voltage: {0} mV")]
InvalidVoltage(f64),
#[error("Invalid concentration: {0}. Must be non-negative")]
InvalidConcentration(f64),
#[error("Synapse not found: {0}")]
SynapseNotFound(usize),
#[error("Neuron not found: {0}")]
NeuronNotFound(usize),
#[error("Invalid network configuration: {0}")]
InvalidNetwork(String),
#[error("Numerical integration error: {0}")]
IntegrationError(String),
}
pub type Result<T> = std::result::Result<T, SynapseError>;