Git Product home page Git Product logo

shorelark's Introduction

🐦 Shorelark

Simulation of evolution, powered by neural networks, genetic algorithms and high school math:

screenshot

Feeling curious? I've described the implementation ab ovo on my blog: Learning to Fly.

Building

Using Cargo and npm

Requires cargo, npm and wasm-pack (0.11.0):

# Clone the repository
$ git clone https://github.com/Patryk27/shorelark
$ cd shorelark

# Build Rust code
$ cd libs/simulation-wasm
$ wasm-pack build --release

# Build TypeScript code
$ cd ../../www
$ npm install

# Start the application
$ npm run start

# Now simply open `http://localhost:8080` in your web browser :-)

Using Nix

# Clone the repository
$ git clone https://github.com/Patryk27/shorelark
$ cd shorelark

# Build the application
$ nix build

# Start the application
$ nix run nixpkgs#php -- -S localhost:8080 -t result

# Now simply open `http://localhost:8080` in your web browser :-)

Usage

Shorelark contains an in-game introduction - just read what the terminal on the left side says and have fun!

License

Copyright (c) 2020 Patryk Wychowaniec [email protected].
Licensed under the MIT license.

shorelark's People

Contributors

javiertury avatar lmxia avatar patryk27 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

shorelark's Issues

COMPILE ERROR

Compiling serde_json v1.0.59
error[E0658]: use of unstable library feature 'btreemap_remove_entry'
How can I fix this problem?

Angles problems?

I convert the web pack app part into a vite/react-ts project then try to play a bit with the code and found an interesting thing.

image

PS: I changed to fov angle to PI/2 but that's not the point.

I try to render the fov because your 'arcs' seems a bit off and here's what I saw.

It comes from this part

image

I don't know why you added Math.PI / 2.0 here ? probably because otherwise we see the fov on the side and not in front of them, but IT REALLY is on the side, you can look with your drawn arcs and this is why birds are constantly turning.

Tutorial: Eye angle to axis

Awesome tutorial. I really love it.

I think I found a small misunderstanding in the tutorial. In the explanation of process_vision of eye it says at the second point where the angles are handled:

    // Returns vector's direction relative to the X axis, that is:
    //
    //   --> = 0° = 0
    //
    //    |  = 90° = PI / 2
    //    v
    //
    //   <--- = 180° = PI
    //
    // (if you've been measuring rotations before - this is atan2
    // in disguise.)
    let angle = na::Rotation2::rotation_between(
        &na::Vector2::y(),
        &vec,
    ).angle();

According to the code, it should explain the vector's direction according to the Y axis.

See also: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b7024ce656547f3095bc35dbadd36a41

Add license file and/or SPDX tag

I know the README.md states this is licensed in MIT, but it would be better to have an explicit LICENSE.txt file. There are several variants of MIT license, so which is it?
Even better to have an SPDX tag in each source file.

`impl Trait` in type aliases is unstable

Got this err at line 42 of Chromosome.rs. Due to that IntoIterator() breaks a number of other places. Surprised this hasn't popped up before. Using rustc 1.68.2.

wasm-pack build error type IntoIter = impl Iterator<Item = f32>;

I followed readme and failed on "wasm-pack build --release"
the versions :

[root@VM-16-13-centos simulation-wasm]# cargo --version
cargo 1.51.0 (43b129a20 2021-03-16)
[root@VM-16-13-centos simulation-wasm]# rustc --version
rustc 1.51.0 (2fd73fabe 2021-03-23)
[root@VM-16-13-centos simulation-wasm]# rustup --version
rustup 1.23.1 (3df2264a9 2020-11-30)

the error info:

error[E0658]: `impl Trait` in type aliases is unstable
  --> libs/genetic-algorithm/src/chromosome.rs:41:21
   |
41 |     type IntoIter = impl Iterator<Item = f32>;
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
   = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable

warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> libs/genetic-algorithm/src/lib.rs:1:12
  |
1 | #![feature(type_alias_impl_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information

error: aborting due to previous error; 1 warning emitted

new to rust, what should i do?

Part 3

I'm waiting for part 3 of the tutorial series :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.