Last fixes
This commit is contained in:
@ -22,8 +22,8 @@ public class Simulation {
|
|||||||
|
|
||||||
// set some system parameters
|
// set some system parameters
|
||||||
public static final double SECTION_SIZE = 2 * AU; // the size of the square region in space
|
public static final double SECTION_SIZE = 2 * AU; // the size of the square region in space
|
||||||
public static final int NUMBER_OF_BODIES = 220;
|
public static final int NUMBER_OF_BODIES = 10000;
|
||||||
public static final double OVERALL_SYSTEM_MASS = 20 * SUN_MASS; // kilograms
|
public static final double OVERALL_SYSTEM_MASS = 2000 * SUN_MASS; // kilograms
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
CodeDraw cd = new CodeDraw();
|
CodeDraw cd = new CodeDraw();
|
||||||
@ -51,22 +51,11 @@ public class Simulation {
|
|||||||
while (true) {
|
while (true) {
|
||||||
seconds++;
|
seconds++;
|
||||||
|
|
||||||
/*
|
|
||||||
BodyLinkedList mergedBodies = new BodyLinkedList();
|
|
||||||
for (Body b1 : bodies) {
|
|
||||||
BodyLinkedList colliding = bodies.removeCollidingWith(b1);
|
|
||||||
for (Body b2 : colliding) {
|
|
||||||
b1 = b1.merge(b2);
|
|
||||||
}
|
|
||||||
mergedBodies.addLast(b1);
|
|
||||||
}
|
|
||||||
bodies = mergedBodies;
|
|
||||||
*/
|
|
||||||
Octree octree = new Octree(new Vector(0, 0, 0), SECTION_SIZE);
|
Octree octree = new Octree(new Vector(0, 0, 0), SECTION_SIZE);
|
||||||
for (Body body : bodies) {
|
for (Body body : bodies) {
|
||||||
octree.add(body);
|
octree.add(body);
|
||||||
}
|
}
|
||||||
octree.applyForces(bodies, 1);
|
octree.applyForces(bodies, 100);
|
||||||
|
|
||||||
if ((seconds % 60) == 0) {
|
if ((seconds % 60) == 0) {
|
||||||
cd.clear(Color.BLACK);
|
cd.clear(Color.BLACK);
|
||||||
|
Reference in New Issue
Block a user