Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/lamont/test/particle.diderot
ViewVC logotype

Annotation of /branches/lamont/test/particle.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2090 - (view) (download)

1 : lamonts 2083
2 :     int worldWidth = 500;
3 :     int worldHeight = 500;
4 : lamonts 2090 int strandSize = 4;
5 : lamonts 2083
6 :     // Particle(x,y)
7 :     strand Particle (int x, int y) {
8 :     vec2 pos = [real(x),real(y)];
9 :     int id = x * worldWidth + y;
10 :     vec4 neighbor = [0.0, 0.0, 0.0, 0.0];
11 :     // output vec4 neighbors = [0.0, 0.0, 0.0, 0.0];
12 :     output int neighborCount = 0;
13 :    
14 :     update {
15 :     int t = 3;
16 : lamonts 2090 int count = strandSize;
17 : lamonts 2083 foreach(Particle p in sphere(5)){
18 :     t = p.id;
19 :     count = count + 1 + t;
20 :     }
21 :     neighborCount = count;
22 :     stabilize;
23 :     }
24 :     }
25 :    
26 :     initially [ Particle(ui, vi) | vi in 0..(worldHeight-1), ui in 0..(worldWidth-1) ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0