fn skewed(skew: &str, bias: i8) -> Self {
        // Randomly generate a number between 0 and the given bias
        let val = rand::thread_rng().gen_range(0..=bias);

        // Check the skew value
        match skew {
            // Skew towards the active state
            "active" => match val {
                // If generated number is 0, return a Passive cell.
                0 => BinaryCell::Passive,
                // Otherwise return an Active cell.
                _ => BinaryCell::Active,
            },
            // Skew towards the passive state
            "passive" => match val {
                // If generated number is 0, return an Active cell.
                0 => BinaryCell::Active,
                // Otherwise return a Passive cell.
                _ => BinaryCell::Passive,
            }
            // Invalid skew value
            _ => panic!("invalid skew value")
        }
    }
/// A constructor function that generates a new BinaryCell with a skewed random state.
/// Skewed generation means that there is a higher probability for a cell to be a particular state.
///
/// - @param *skew* is a bool that determines whether the skew state is passive or active.
/// - @param *bias* is an i8 that represents the skew ratio between the non-preferred and preferred state. 
///
/// A bias of 1 is equivalent to a balanced state generation regardless of the skew value (1:1).
/// A bias of 100 with a skew value of "active", results in 1:100 ratio leaning towards the active state.
///
/// Valid values for skew are "active" and "passive".
A constructor function that generates a new BinaryCell with a skewed random state.
Skewed generation means that there is a higher probability for a cell to be a particular state.

@param *skew* is a bool that determines whether the skew state is passive or active.
@param *bias* is an i8 that represents the skew ratio between the non-preferred and preferred state.

A bias of 1 is equivalent to a balanced state generation regardless of the skew value (1:1).
A bias of 100 with a skew value of "active", results in 1:100 ratio leaning towards the active state.

Valid values for skew are "active" and "passive".
A constructor function that generates a new BinaryCell with a skewed random state . Skewed generation means that there is a higher probability for a cell to be a particular state . @param * skew * is a bool that determines whether the skew state is passive or active . @param * bias * is an i8 that represents the skew ratio between the non - preferred and preferred state . A bias of 1 is equivalent to a balanced state generation regardless of the skew value ( 1 : 1 ) . A bias of 100 with a skew value of " active " results in 1 : 100 ratio leaning towards the active state . Valid values for skew are " active " and " passive " .
fn skewed(skew: &str, bias: i8) -> Self {
        // Randomly generate a number between 0 and the given bias
        let val = rand::thread_rng().gen_range(0..=bias);
        // Check the skew value
        match skew {
            // Skew towards the active state
            "active" => match val {
                // If generated number is 0, return a Passive cell.
                0 => BinaryCell::Passive,
                // Otherwise return an Active cell.
                _ => BinaryCell::Active,
            },
            // Skew towards the passive state
            "passive" => match val {
                // If generated number is 0, return an Active cell.
                0 => BinaryCell::Active,
                // Otherwise return a Passive cell.
                _ => BinaryCell::Passive,
            }
            // Invalid skew value
            _ => panic!("invalid skew value")
        }
    }
fn skewed ( skew : & str , bias : i8 ) -> Self { // Randomly generate a number between 0 and the given bias let val = rand :: thread_rng ( ) . gen_range ( 0 ..= bias ) ; // Check the skew value match skew { // Skew towards the active state " " => match val { // If generated number is 0, return a Passive cell. 0 => BinaryCell :: Passive , // Otherwise return an Active cell. _ => BinaryCell :: Active , } , // Skew towards the passive state " " => match val { // If generated number is 0, return an Active cell. 0 => BinaryCell :: Active , // Otherwise return a Passive cell. _ => BinaryCell :: Passive , } // Invalid skew value _ => panic ! ( " " ) } }
A constructor function that generates a new BinaryCell with a skewed random state.
A constructor function that generates a new BinaryCell with a skewed random state .
skew
&str
bias
i8
skew
&str
bias
i8