restructure src
This commit is contained in:
parent
e176fbb11e
commit
0f11295b45
9
src/action.rs
Normal file
9
src/action.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
pub struct Point {
|
||||||
|
pub x: i32,
|
||||||
|
pub y: i32
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Action {
|
||||||
|
pub source: Point,
|
||||||
|
pub destination: Point
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
mod manager;
|
|
||||||
mod applier;
|
|
||||||
mod worker;
|
|
||||||
mod structure;
|
|
||||||
mod block;
|
|
||||||
mod action;
|
|
32
src/block.rs
Normal file
32
src/block.rs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
use action::Action;
|
||||||
|
use std::vec;
|
||||||
|
|
||||||
|
trait Block {
|
||||||
|
fn get_connections(&self) -> &Vec<f64>;
|
||||||
|
fn get_value(&self) -> &f64;
|
||||||
|
fn get_name(&self) -> &'static str;
|
||||||
|
fn compute(&self) -> Vec<Action>;
|
||||||
|
fn clean(&self);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct NeuronBlock {
|
||||||
|
connections: Vec<f64>,
|
||||||
|
current_value: f64,
|
||||||
|
new_value: f64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Block for NeuronBlock {
|
||||||
|
fn get_connections(&self) -> &Vec<f64> {
|
||||||
|
&self.connections
|
||||||
|
}
|
||||||
|
fn get_value(&self) -> &f64 {
|
||||||
|
&self.current_value
|
||||||
|
}
|
||||||
|
fn get_name(&self) -> &'static str {
|
||||||
|
"Neuron"
|
||||||
|
}
|
||||||
|
fn compute(&self) -> Vec<Action> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
fn clean(&self) { }
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
mod alrium;
|
mod action;
|
||||||
|
mod block;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
|
Loading…
Reference in New Issue
Block a user