This commit is contained in:
Alexander Nozik 2017-08-07 21:31:04 +03:00
commit 6a0cde8b90
3 changed files with 24 additions and 17 deletions

View File

@ -32,7 +32,7 @@ public class PKT8VirtualPort extends VirtualPort implements Metoid {
case "s": case "s":
String[] letters = {"a", "b", "c", "d", "e", "f", "g", "h"}; String[] letters = {"a", "b", "c", "d", "e", "f", "g", "h"};
for (String letter : letters) { for (String letter : letters) {
Meta channelMeta = MetaUtils.findNodeByValue(meta(), "channel", "letter", Value.of(letter)); Meta channelMeta = MetaUtils.findNodeByValue(meta(), "channel", "letter", Value.of(letter)).orElse(Meta.empty());
double average; double average;
double sigma; double sigma;

View File

@ -28,16 +28,23 @@ public class SmartAnalyzer extends AbstractAnalyzer {
@Override @Override
public Values analyze(NumassBlock block, Meta config) { public Values analyze(NumassBlock block, Meta config) {
//TODO add result caching //TODO add result caching
//TODO do something more... smart... using information from point if block is point if(config.hasValue("type")) {
switch (config.getString("type", "simple")) { switch (config.getString("type")) {
case "simple": case "simple":
return simpleAnalyzer.analyze(block, config); return simpleAnalyzer.analyze(block, config);
case "time": case "time":
return timeAnalyzer.analyze(block, config); return timeAnalyzer.analyze(block, config);
case "debunch": case "debunch":
return debunchAnalyzer.analyze(block, config); return debunchAnalyzer.analyze(block, config);
default: default:
throw new IllegalArgumentException("Analyzer not found"); throw new IllegalArgumentException("Analyzer not found");
}
} else {
if(config.hasValue("t0")){
return timeAnalyzer.analyze(block,config);
} else {
return simpleAnalyzer.analyze(block,config);
}
} }
} }
} }

View File

@ -10,7 +10,7 @@ import inr.numass.models.LossCalculator
LossCalculator loss = LossCalculator.instance() LossCalculator loss = LossCalculator.instance()
def X = 0.34 def X = 0.36
def lossProbs = loss.getGunLossProbabilities(X); def lossProbs = loss.getGunLossProbabilities(X);
@ -30,11 +30,11 @@ printf("%8s\t%8s\t%8s\t%8s\t%n",
*/ */
def singleScatter = loss.getSingleScatterFunction( def singleScatter = loss.getSingleScatterFunction(
12.587, 12.860,
11.11, 16.62,
1.20, 1.71,
11.02, 12.09,
2.43 4.59
); );
for (double d = 0; d < 30; d += 0.3) { for (double d = 0; d < 30; d += 0.3) {