All Projects → fogleman → Dlaf

fogleman / Dlaf

Licence: mit
Diffusion-limited aggregation, fast.

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Dlaf

Zanphp
PHP开发面向C10K+的高并发SOA服务 和RPC服务首选框架
Stars: ✭ 1,451 (+830.13%)
Mutual labels:  high-performance
Shadesmar
Fast C++ IPC using shared memory (with msgpack)
Stars: ✭ 126 (-19.23%)
Mutual labels:  high-performance
Go Sessions
🔐 The sessions manager for the Go Programming Language. Supports both net/http and fasthttp.
Stars: ✭ 134 (-14.1%)
Mutual labels:  high-performance
Edgedb Python
EdgeDB Python Driver
Stars: ✭ 113 (-27.56%)
Mutual labels:  high-performance
Rapidoid
Rapidoid - Extremely Fast, Simple and Powerful Java Web Framework and HTTP Server!
Stars: ✭ 1,571 (+907.05%)
Mutual labels:  high-performance
Easylogger
An ultra-lightweight(ROM<1.6K, RAM<0.3k), high-performance C/C++ log library. | 一款超轻量级(ROM<1.6K, RAM<0.3k)、高性能的 C/C++ 日志库
Stars: ✭ 1,968 (+1161.54%)
Mutual labels:  high-performance
Netty Rest
Yet another high performance REST server based on Netty
Stars: ✭ 107 (-31.41%)
Mutual labels:  high-performance
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (-6.41%)
Mutual labels:  high-performance
Threadsx.jl
Parallelized Base functions
Stars: ✭ 126 (-19.23%)
Mutual labels:  high-performance
Lindb
LinDB is a scalable, high performance, high availability distributed time series database.
Stars: ✭ 2,105 (+1249.36%)
Mutual labels:  high-performance
Servicestack.ormlite
Fast, Simple, Typed ORM for .NET
Stars: ✭ 1,532 (+882.05%)
Mutual labels:  high-performance
Blasfeo
Basic linear algebra subroutines for embedded optimization
Stars: ✭ 120 (-23.08%)
Mutual labels:  high-performance
Sunengine
SunEngine – site engine with blog, forum and articles sections features support.
Stars: ✭ 130 (-16.67%)
Mutual labels:  high-performance
Nanolog
Nanolog is an extremely performant nanosecond scale logging system for C++ that exposes a simple printf-like API.
Stars: ✭ 1,710 (+996.15%)
Mutual labels:  high-performance
Nuster
A high performance HTTP proxy cache server and RESTful NoSQL cache server based on HAProxy
Stars: ✭ 1,825 (+1069.87%)
Mutual labels:  high-performance
Tlaplus
TLC is an explicit state model checker for specifications written in TLA+. The TLA+Toolbox is an IDE for TLA+.
Stars: ✭ 1,618 (+937.18%)
Mutual labels:  high-performance
Actors
Evaluation of API and performance of different actor libraries
Stars: ✭ 125 (-19.87%)
Mutual labels:  high-performance
Rotoscope
High-performance logger of Ruby method invocations
Stars: ✭ 151 (-3.21%)
Mutual labels:  high-performance
Tendis
Tendis is a high-performance distributed storage system fully compatible with the Redis protocol.
Stars: ✭ 2,295 (+1371.15%)
Mutual labels:  high-performance
Beecp
A High Performance JDBC Connection Pool
Stars: ✭ 131 (-16.03%)
Mutual labels:  high-performance

dlaf

Diffusion-limited aggregation, fast. Diffusion-limited as f*ck.

Features

  • 2D or 3D diffusion-limited aggregation
  • Super fast? 35 seconds to compute one million points on a single core.

Dependencies

  • boost (used for its spatial index)

Usage

git clone https://github.com/fogleman/dlaf.git
cd dlaf
make
./dlaf > output.csv

Output Format

The parent_id tells you which particle was joined to. It is -1 for initial seed positions. When 2D is used, Z will be zero for all points.

# columns are: id, parent_id, x, y, z
$ head output.csv
0,-1,0,0,0
1,0,0.934937,0.354814,0
2,0,0.0525095,-0.99862,0
3,1,0.989836,1.35331,0
4,3,1.92472,1.70826,0
5,3,0.65572,2.29584,0
6,4,2.90818,1.88937,0
7,0,-0.989205,0.146538,0
8,2,0.917631,-1.50018,0
9,5,0.832028,3.28017,0

Hooks & Parameters

The code implements a standard diffusion-limited aggregation algorithm. But there are several parameters and code hooks that let you tweak its behavior.

The following parameters can be set on a Model instance.

Parameter Description
AttractionDistance Defines how close together particles must be in order to join together.
ParticleSpacing Defines the distance between particles when they become joined together.
MinMoveDistance Defines the minimum distance that a particle will move in an iteration during its random walk.
Stubbornness Defines how many join attempts must occur before a particle will allow another particle to join to it.
Stickiness Defines the probability that a particle will allow another particle to join to it.

The following hooks allow you to define the algorithm behavior in small, well-defined functions.

Hook Description
RandomStartingPosition() Returns a starting position for a new particle to begin its random walk.
ShouldReset(p) Returns true if the particle has gone too far away and should be reset to a new random starting position.
ShouldJoin(p, parent) Returns true if the point should attach to the specified parent particle. This is only called when the point is already within the required attraction distance. If false is returned, the particle will continue its random walk instead of joining to the other particle.
PlaceParticle(p, parent) Returns the final placement position of the particle.
MotionVector(p) Returns a vector specifying the direction that the particle should move for one iteration. The distance that it will move is determined by the algorithm.

Rendering

Rendering is left to you. This code just gives you the location of the points and their hierarchy. But here is an example rendering in 2D with one million particles:

Example

And here is a 3D example with 10 million particles. This image was ray traced in about 10 hours at 4096x4096px with 2048 samples per pixel. Full resolution here.

Example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].