Switch to gradle build

user: Alexander Nozik <altavir@gmail.com>
This commit is contained in:
Alexander Nozik 2016-05-08 18:44:14 +03:00
parent 9bb67f5691
commit 8e517aeecb
3 changed files with 8 additions and 12 deletions

View File

@ -11,7 +11,6 @@ import java.util.stream.Stream;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.SphericalCoordinates;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math3.random.JDKRandomGenerator;
import org.apache.commons.math3.random.MersenneTwister;
import org.apache.commons.math3.random.RandomGenerator;
import org.apache.commons.math3.random.SynchronizedRandomGenerator;
@ -29,7 +28,7 @@ public class ElectronTrappingSimulator {
double Elow = 14000d;
double thetaTransport = 24.107064 / 180 * Math.PI;
double thetaPinch = 19.481097 / 180 * Math.PI;
public ElectronTrappingSimulator() {
generator = new SynchronizedRandomGenerator(new MersenneTwister());
@ -159,7 +158,7 @@ public class ElectronTrappingSimulator {
double phi = generator.nextDouble()* 2 * Math.PI;
//Создаем начальный вектор в сферических координатах
SphericalCoordinates init = new SphericalCoordinates(1, 0, theta + dTheta);
// Задаем вращение относительно оси, перпендикулярной исходному вектору
// Задаем вращение относительно оси, перпендикулярной исходному вектору
SphericalCoordinates rotate = new SphericalCoordinates(1, 0, theta);
// поворачиваем исходный вектор на dTheta
Rotation rot = new Rotation(rotate.getCartesian(), phi);

View File

@ -16,7 +16,6 @@
package inr.numass.trapping;
import java.io.PrintStream;
import java.io.PrintWriter;
import static java.lang.Integer.valueOf;
import java.util.HashMap;
import java.util.Map;

View File

@ -17,15 +17,13 @@ public class Trapping {
File file = new File(args[0]);
out = new PrintStream(file);
} else {
}
double E = 18000d;
System.out.println();
// System.setProperty("jna.library.path", "d:\\projects\\Trapping\\target\\classes\\win32-amd64\\libScatter.dll");
ElectronTrappingSimulator simulator = new ElectronTrappingSimulator();
simulator.setFields(0.6, 3.6, 7.2);
// ElectronTrappingSimulator.SimulaionResult result;
int accepted = 0;
int pass = 0;
@ -33,18 +31,18 @@ public class Trapping {
int lowE = 0;
simulator.scatter.counter.resetAll();
List<ElectronTrappingSimulator.SimulaionResult> results = simulator.simulateAll(E, 10000);
List<ElectronTrappingSimulator.SimulaionResult> results = simulator.simulateAll(E, (int) 1e6);
simulator.scatter.counter.print(System.out);
System.out.printf("%nSimulation complete.%n%n");
for (ElectronTrappingSimulator.SimulaionResult res : results) {
if (out != null) {
ElectronTrappingSimulator.printOne(System.out, res);
}
switch (res.state) {
case ACCEPTED:
// ElectronTrappingSimulator.printOne(System.out, res);
if (out != null) {
ElectronTrappingSimulator.printOne(out, res);
}
accepted++;
break;
case LOWENERGY: