about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go36
1 files changed, 12 insertions, 24 deletions
diff --git a/main.go b/main.go
index e831ef3..3d23ad2 100644
--- a/main.go
+++ b/main.go
@@ -4,48 +4,36 @@ import (
 	"fmt"
 	"git.darknebu.la/GalaxySimulator/Source/csv"
 	"git.darknebu.la/GalaxySimulator/Source/draw"
-	// "git.darknebu.la/GalaxySimulator/Source/forces"
+	"git.darknebu.la/GalaxySimulator/Source/forces"
 	"git.darknebu.la/GalaxySimulator/Source/structs"
-	"git.darknebu.la/bit/logplus"
-	// "math"
-	"os"
+	"math"
 )
 
 func main() {
-	// Define a logging level for logplus
-	logplus.SetLogLevel(logplus.LevelAll)
-
-	// var threads int = 8
+	var threads int = 8
 	var frames int = 1
 	var rangeStart int = 0
-
-	// Error handling (panic if there enouth arguments are provided)
-	if len(os.Args) < 2 {
-		panic("It seems like you forgot to supply a number of stars!")
-	}
-	rangeEnd, _ := os.Args[1]
+	var rangeEnd int = 1
+	var path string = "data/U_ALL.csv"
 
 	// the slice starsSlice stores the star structures
 	starsSlice := []structs.Star2D{}
+	starsSlice = csv.Import(path, rangeStart, rangeEnd, starsSlice)
 
-	// Import data from a csv
-	logplus.LogNeutralf("Opening the csv")
-	starsSlice = csv.Import("data/U_ALL.csv", rangeStart, rangeEnd, starsSlice)
+	fmt.Println("Done loading the data")
 
 	// Simulate frames
 	for i := 0; i < frames; i++ {
-		logplus.LogPositivef("--- --- --- --- ---")
-		// logplus.LogPositive(fmt.Sprintf("Frames %d/%d", i, frames))	logplus.LogPositive("Done drawing the quadtree")
+		fmt.Println("Calculating the frame")
 
-		// logplus.LogNeutral("Calculate the new Star positions")
-		// starsSlice = forces.NextTimestep(starsSlice, 25*math.Pow(10, 4+7))
+		starsSlice = forces.NextTimestep(starsSlice, 25*math.Pow(10, 4+7))
+		starsSlice = forces.CalcAllAccelerations(starsSlice, threads)
 
-		// logplus.LogNeutral("Calculate the acting accelerations")
-		// starsSlice = forces.CalcAllAccelerations(starsSlice, threads)
+		fmt.Println("Done Calculating")
 
 		// draw the galaxy
 		outputName := fmt.Sprintf("out_%d.png", i+4)
-		logplus.LogNeutralf(fmt.Sprintf("draw the slice and save it to %s", outputName))
 		draw.Slice(starsSlice, outputName)
+		fmt.Println("Done drawing all the stars")
 	}
 }