Git Product home page Git Product logo

abstractions's Introduction

Abstractions

An R experiment to create images inspired by Physarum model. Some examples:

Getting Started

Prerequisites

You will need to install the following packages (if you don't have them already):

install.packages("tidyverse")
install.packages("Rcpp")
install.packages("reshape2")
install.packages("colourlovers")

More info

  • A complete explanation of the experiment can be found at fronkonstin

Inspiration

  • Characteristics of Pattern Formation and Evolution in Approximations of Physarum Transport Networks, by Jeff Jones (University of the West of England)

Author

abstractions's People

Contributors

aschinchon 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

abstractions's Issues

physarum() function not defined

I couldn't get this to work as the physarum() function is never defined.

From lines 61-63:

Make agents dance

envM <- physarum(envM, parF, decayT, FL, FR,
RA, SO, SS, depT, iters)

magnetic field typo?

# Create a magnetic disc
for (i in 1:nrow(envM)){
  for (j in 1:ncol(envM)){
    if(sqrt((i-imageH/2)^2+(j-imageH/2)^2)>imageH/8 &
       sqrt((i-imageH/2)^2+(j-imageH/2)^2)<imageH/6) envM[i,j]=5
  }
}

if that is supposed to create a circle then it should use i-imageH and j-imageW something like

for (y in 1:nrow(envM)){
  for (x in 1:ncol(envM)){
    y2 = (y-imageH/2)
    x2 = (x-imageW/2)
    d = sqrt( x2*x2 + y2*y2 )
    if( d >imageH/8 & d <imageH/6) envM[i,j]=5
  }
}

'colourlovers' package is broken

I replaced this piece of code and get rid of this dependency

#Pick a top palette from colourlovers
url <- "http://www.colourlovers.com/api/palettes/top&format=json"
out <- rjson::fromJSON(readLines(url)[1], simplify = TRUE)
palette <- data.table::rbindlist(out)
colors <- palette %>% filter(id == sample(palette$id,1)) %>% select(colors) %>% pull %>% paste0("#", .)

#palette <- sample(clpalettes('top'), 1)[[1]]
#colors <- palette %>% swatch %>% .[[1]]

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.