Robin Åstedt/projects/

Back | CC BY-NC-SA 3.0 applies when no license is included.

Table of contents

Make Curry
Java Nursery
Gentzen's Quest
Dynamic Grid
Walking Is Hard
EvoScape
Cellular Soft Body
Neural Net Evolution
Fractal
Natural Selection

Make Curry

C++ Utility

Utility function for making curry out of multiple argument functions!

When programming in C++, do you often find yourself missing the magic of Haskell's naturally curried syntax? Then this is for you! Avoid declaring functions using the mess that is nested lambda expressions and simply use the normal C++ syntax to declare your functions like a sane person and make_curry will translate it into a curryingable function for you!

Read more...

Back to the top

JavaNursery

Java Utility

A Java implementation of a new concurrent control flow primitive as described in an article by Nathaniel J. Smith.

The basic idea is that control flow enters a nursery and continues under it after all threads started inside the nursery scope have returned. The construct also deals with unchecked exceptions being thrown inside a child thread by interrupting the other children, waits for them to terminate and then propagating the exception up the stack.

Read more...

Back to the top

Gentzen's Quest

Android Java App

As my bachelor thesis me and my project group was tasked with building a game for smartphones to gamify formal logic. We choose to use natural deduction as the proof method as it works very well for a puzzle game as it encourages exploration. Expressions are represented as cards, which can be combined in various ways to create new expressions. These actions that can be applied on one or more expressions are all logically equivalent to the rules you can apply in natural deduction. So the goal of the project has been that for a given solution to a puzzle in the game, the sequence of actions taken in the game can be translated into a logically sound proof by natural deduction.

My role in the project has so far been almost entirely working on the backend, or from a MVC perspective I was mostly involved with designing and implementing the model and the controller.

Read more...

Back to the top

Dynamic Grid

Cross-platform C++ Data structure

Dynamic storage in n dimensions supporting negative coordinates. Supports automatic memory allocation and both access by value or reference. The real magic happens in the way it interally stores the elements. It's built to minimize heap memory lookups and pointer derefencing, as well as utilizing the CPU cache as much as possible when several nearby coordinates are looked up sequentially by storing everything in a single std::vector by utilizing a nifty mapping technique from ℤn -> ℕ.

Read more...

Back to the top

Walking Is Hard

Cross-platform Java 8

Creatures that evolve to traverse increasingly difficult terrain.

The creature's DNA describes its joints and muscles that connect them, as well as all their attributes. The muscles are in physics terms a spring and a dampener with a rest state that varies from 1 to 0.5 times their original length from a sinus function over time with an aribitrary phase and frequency.

After the first lanuch "config.properties" will be created where you can tweak settings.

Read more...

Screenshot

Back to the top

EvoScape [WORK IN PROGRESS]

Cross-platform Java 7

The goal of this project is to be able to procedurally generate planets with very high details and accurecy. The planets are devided in a geodesic grid to avoid blurring and artifacts. In the future it will probably be the basis of some kind of ecosystem simulation and/or game.

Read more...

Screenshot

Back to the top

Cellular Soft Body [WORK IN PROGRESS]

Cross-platform Java 8

Artificial multi-cellular organisms which features neural networks and resource distibution in an evolutionary setting with soft-body physics.

Read more...

Screenshot of CellularSoftBody version 0.3.4

Back to the top

Neural Net Evolution

Windows .NET 4.5

Artificial life simulation with organisms that evolve over time. They all possess an eye with several receptors which each ray trace their enviroment and measure red, green, blue and distance. This information is then sent to a neural network which is described by its DNA. Other input is its internal health. The net is then controlling its actuators, which includes motion, projected body color, a speed boost and a spike weapon. The two latter comes at a energy cost.

They can hunt for food either by killing each other or collecting the spawned food. Each time a piece of food is picked up it's respawned with lesser food content and slightly more red (from green), this to make it harder to survive over time. The organism to survive the longest gets brought over to the next generation and the best half of the rest of the population gets put into a gene pool and randomly mated to produce the offspring for the next iteration. The starting neural net/DNA is originally completely random, but through evolution progressevly gets smarter.

Download [2014-11-16]

Screenshot of Neural Net Evolution

Back to the top

Fractal

Windows .NET 4.0

A multi-threaded renderer for the Mandelbrot fractal with up to 128 bit precision.

Download version 1.2.0.1 [2014-09-29]
Download version 1.0.0.0 [2014-09-15]

Screenshot of Fractal

Back to the top

Natural Selection

Windows .NET 4.0

One of my earliest evolutionary AI projects where each cell is a 8 bit computer with its DNA as machine-code

Every dot is an artificial lifeform whose brain is controlled by its DNA that is a series of 1-byte-machine-code. Their color is repressented by a hash-value derived from said series.
For every step their brains executes one line in their dna and increments their pointer by one, much like a computer does. When it reaches the end of the dna it wraps around and starts from the first position again.
In the beginning it spawns in several organisms with randomized dna with a length of 30 operations.

The following rules governs their behavior:
An organism can not move.
An organisms can turn to face one of four directions.
An organism can spend half its energy to replicate itself in an empty square it's facing. If not empty, it suffers an energy penalty. The replication then has a very small chance of mutating its DNA.
An organism can consume another organism in the square it's facing. If empty, it suffers an energy penalty.
Every operation, with exception to IF-statements costs energy.
Every organism also has a 4 bit register which it can perform IF-statements on, it also transfers this information onto its offspring. Speaking of information storage, new offspring start facing away from their parents at the time of birth.
All energy spent gets put into a Pool, which when it reaches a threshold spawns a new random organism carrying that energy.
If an organism reaches below a certain energy threshold, it is regarded dead and can not perform any more instructions nor spend energy. Its only purpose is food for its competitors.
IF-statements works so that the pointer is increased by 1 if the statement is true, otherwise 1+4, thus skipping the next 4 instructions.

Video [YouTube]

Download [2013-11-26]

Screenshot of Natural Selection

Back to the top

CopyRight © 2009 - 2024 Robin Åstedt
Stylish font: ON
;a