setting arraylist
in
Programming Questions
•
2 years ago
Hi guys,
i'm working on a code but i've run into a problem when i try to run ArrayList.set
the code runs fine with arrayList.add but i'm unable to use this since i'm in void draw and it continuously adds.
I've added a a series of values in the void setup so that the set values don't start blank.
Many thanks,
akeetekt
- for (int i=0;i<imgwidth-2;i+= stepSize) {
- for (int j=0;j<imgheight;j+= stepSize) {
- Vec3D origin = new Vec3D(i*gridSize, j*gridSize, 0);
- Agent myAgent = new Agent(origin, color(0, 0, 255), att[i][j]);
- int x= i/stepSize;
- int y = j/stepSize;
- muAttractor.set(x+(y*imgwidth/stepSize), myAgent);
- // muAttractor.add(myAgent);
- }
- }
1