/** * cellularautomata.java * part of cellularAutomata * * Used to visualize Cellular Automata system * * written by Matthew Shanley * matthewshanley@littlesecretsrecords.com */ import oscP5.*; // Variables for World and Beings //static final int RECT_SIZE = 10; static final int RECT_SIZE = 20; static final int STATE_REPORT_BLOCK_SIZE = 10; World myWorld; Being[] myBeings; // Variables for 2 oscP5 instances (local and remote) static final float OSC_SEND_DELAY = 1000; // Time to wait between sending OSC state in milliseconds OscP5 localOscP5; OscP5 remoteOscP5; int localReceiveAtPort; int remoteReceiveAtPort; int localSendToPort; int remoteSendToPort; String localHost; String remoteHost; String oscP5event; float timeLastOscSend; void setup() { // Initializations //size(500, 500); size(800, 600); colorMode(HSB, 360, 100, 100); background(0); loop(); ellipseMode(CORNER); // World constructor takes: int initWidth, int initHeight, int initNumThoughtWords myWorld = new World((width/RECT_SIZE), (height/RECT_SIZE), 350); myBeings = new Being[50]; for (int i=0; i