id
stringlengths
36
36
text
stringlengths
1
1.25M
9fd76e91-9674-4405-ad17-4ee5f5d48f06
@Override public double test(double[][] calib, double[][] test) { double ret = 0.0; double N = 0.0; for (int i = 0; i < calib.length; i++) { for (int j = 0; j < calib[i].length; j++) { N += calib[i][j]; ret += Math.abs(calib[i][j] - test[i][j]...
23ecb6c0-ce1b-444e-9423-63d8ebcf8c21
@Override public String testName() { return "Standard Absolute Error"; }
57da0d85-f048-410b-8cd2-1a82fc5a1796
@Override public String fieldName() { return "SAE"; }
fea64f50-665f-4b5c-b2b3-6c054e8b1e62
@Override public boolean calibrateToLessThan() { return true; }
130a52bc-ba95-45b0-9f32-5a6c75773db7
@Override public boolean isPerfect(double testStat) { if (testStat == 0.0) { return true; } else { return false; } }
7d1d36f7-09c3-4e85-b7e2-44e631e669d9
@Override public String fieldName(){return "R2";}
220f806e-483e-40ac-b969-cc40ca1849e9
@Override public String testName(){return "R squared";}
d35f88e8-06a5-48f5-963b-86f89d65b1b1
@Override public boolean calibrateToLessThan(){return false;}
3cbc5aee-cee2-4f74-9d46-0dffbdbf0246
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
c7b4c352-94b6-4947-868e-8c9714e3c9df
@Override public double test(double[][] calib, double[][] test){ double eq1 = 0; double eq2 = 0; double eq3 = 0; double obsMean; double preMean; double obsTot=0; double preTot=0; // Calculate averages for (int i=0; i<calib.length; i++) { ...
78bc2a88-6fc5-41dc-a16a-188bbfd60be7
public boolean isPerfect(double testStat){ if ( testStat == 1.0 ){return true;}else{return false;} }
5dd1f2b4-4fe5-455d-a568-7013b2e65f3f
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
b6969265-be96-4326-8de9-b60d28793eba
@Override public double test(double[][] calib, double[][] test) { double ret = 0.0; for (int i = 0; i < calib.length; i++) { for (int j = 0; j < calib[i].length; j++) { ret += Math.abs(calib[i][j] - test[i][j]); } } return ret ; }
e4511fba-63a0-443b-9963-3fe08e2cab98
@Override public String testName() { return "Total Absolute Error"; }
37870ac0-31c8-4bc1-acaf-ca953bdcec34
@Override public String fieldName() { return "TAE"; }
2c852298-3e92-4ed5-8bf6-7987babbf12b
@Override public boolean calibrateToLessThan() { return true; }
248eef40-024a-4c8e-afc1-383fefa6e763
@Override public boolean isPerfect(double testStat) { if (testStat == 0.0) { return true; } else { return false; } }
88bb7aa3-6629-4eef-86ea-d3f9ef21bd5f
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
d6f63626-dd52-4ac9-b549-a3ef8143cd58
@Override public double test(double[][] calib, double[][] test) { double ret = 0.0; double N = 0.0; for (int i = 0; i < calib.length; i++) { for (int j = 0; j < calib[i].length; j++) { N += calib[i][j]; ret += Math.abs(calib[i][j] - test[i][j]...
a4092100-afa3-4c8f-bab2-57e3037aeaab
@Override public String testName() { return "Percentage Error"; }
5f120456-669f-4830-8986-092c3a098613
@Override public String fieldName() { return "PE"; }
cee0edd3-acef-4b4a-8647-f7a43bcb969b
@Override public boolean calibrateToLessThan() { return true; }
157c517a-3847-4770-afed-35df3aa4175c
@Override public boolean isPerfect(double testStat) { if (testStat == 0.0) { return true; } else { return false; } }
5307e5c1-bbc0-47c5-98e7-966e555143e0
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
3ab4cf41-8df3-44a5-a32a-2b8b62d6b68e
@Override public double test(double[][] calib, double[][] test) { double ret = 0.0; for (int i = 0; i < calib.length; i++) { for (int j = 0; j < calib[i].length; j++) { ret += Math.abs(calib[i][j] - test[i][j]); } } return ( ret / 2.0 );...
e3998ac6-56ef-44e8-9406-988948cc3d1f
@Override public String testName() { return "Total Error"; }
8c64b248-9379-436b-873e-4e0fbf2085b0
@Override public String fieldName() { return "TE"; }
5a89c2b2-c11d-4036-b744-5800e8fcefb9
@Override public boolean calibrateToLessThan() { return true; }
d7fa71de-2b8b-4535-b8b7-132229b0f752
@Override public boolean isPerfect(double testStat) { if (testStat == 0.0) { return true; } else { return false; } }
9fa46696-936b-4f9e-a8ad-2bda00d9a2f8
public double test(double[][] calib, double[][] test);
65288fb2-5cc9-4f40-9f21-f9b95aee553b
public double test(double[][] calib, double[][] test, double N);
0995cf97-2eee-443d-9a94-4b3f10c640a4
public String testName();
aaefcd59-6467-417c-b360-ea544b7f4558
public String fieldName();
7098a653-bf62-4e40-a6bf-b8b56d308212
public boolean calibrateToLessThan();
febaa798-2fab-4e81-9f6a-431a66c0bf50
public boolean isPerfect(double testStat);
d168e3b0-eb4d-45fe-ab5a-6376979dba7c
@Override public String fieldName(){return "AED";}
fb7a5ae8-7067-412b-83f7-b2f754155d6f
@Override public String testName(){return "Absolute Entropy Difference";}
b1137851-6db3-4f5f-ac92-bc304de921f6
@Override public boolean calibrateToLessThan(){return true;}
8d451ac6-a65f-40c8-acbc-4512f9e460e1
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
6c97aa75-fe0a-47c4-a101-1805ad475a76
@Override public double test(double[][] calib, double[][]test){ //Pij=Tij/N //where //Tij is the number of interactions between origin i and destination j //and N is the total number of trips in the matirx //AED = |Hp-Hq| //where //(basically observed matri...
915ce815-9831-4c14-9c49-75c04cfe5b9d
public boolean isPerfect(double testStat){ if ( testStat == 0.0 ){return true;}else{return false;} }
eea6fdc4-7809-4792-bcf8-7abb5690e9f9
@Override public String fieldName(){return "Entropy";}
280d2aa7-26bc-4ba3-8751-ec03de51850f
@Override public String testName(){return "Entropy (standard entropy measure)";}
16228a4c-705b-4186-b1a1-cbf5c0bae04b
@Override public boolean calibrateToLessThan(){return false;}
4317f2a8-9af3-43f6-aed8-9eb0d9555787
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
55f90dce-01d5-4113-8c9d-f3b0a438aa13
@Override public double test(double[][] calib, double[][] test){ double Nq=0; double Hq=0; for (int i=0;i<test.length;i++){ for (int j=0;j<test[i].length;j++){ //get the total number of trips in the matrix Nq+=test[i][j]; } }...
c5eb656d-8300-4ef4-8ad7-b27677eb5e6b
public boolean isPerfect(double testStat){ return false; }
fb9ffb23-f193-4b50-be46-c748e574c9b3
@Override public String fieldName(){return "Z sq";}
8d363a49-56c4-4337-8ae9-f4aecdda859f
@Override public String testName(){return "<html>Z<sup>2</sup></html>";}
16b495ad-e732-4eef-96d7-6b081d5afec8
@Override public boolean calibrateToLessThan(){return true;}
dbd32ce7-4eec-4079-acb1-4255f926dfae
@Override public double test(double[][] calib, double[][] test, double N){ double Z = 0.0; for (int i=0; i<calib.length; i++) { for (int j=0; j<calib[i].length; j++) { double z = ZScore.calcZScore( test[i][j], calib[i][j], N); Z += (z*z); } ...
b17083b2-a407-47e2-b2fc-49e5fccabae3
@Override public double test(double[][] calib, double[][] test){ double N=0.0; // Calculate total count for (int i=0; i<calib.length; i++) { for (int j=0; j<calib[i].length; j++) { N += calib[i][j]; } } return test(calib, test, N); ...
aeda1c5c-9f5c-4286-9ab5-7986192ea975
@Override public boolean isPerfect(double testStat){ //this method needs to be completed //should return true if the testStat represents a perfect fit return false; }
22c67fc1-29b7-43b6-a2c1-7f87cef706a8
public IGOF createTest(int testType){ switch(testType){ case GOF_SRMSE: return new SRMSE(); case GOF_AED: return new AED(); case GOF_R2: return new R2(); case GOF_ENTROPY: return new Entropy(); ...
e117a951-5382-4c4f-9d39-8025c0454bb9
public JPanel getGOFPanel(){ JPanel jp = new JPanel(); GridLayout grid = new GridLayout(); grid.setRows(cb.length); jp.setLayout( grid ); for (int i = 0; i < cb.length; i++) { cb[i] = new JCheckBox(createTest(i).testName()); jp.add(cb[i]); ...
e78497b0-ed77-4788-bcd3-5e82c79671c2
public IGOF[] getGOFTestsSelected(){ ArrayList<IGOF> selGof = new ArrayList<IGOF>(); for (int i = 0; i < cb.length; i++) { if ( cb[i].isSelected() ){ selGof.add( createTest(i) ); } } IGOF[] g = new IGOF[selGof.size()]; selGof.toArray(g); ...
218ddf59-009b-4c3f-8c9d-0b6c06e29c28
@Override public double test(double[][] calib, double[][] test, double N){ return test(calib,test); }
de1e8395-b6ad-4235-8245-f4e04c24dade
@Override public double test(double[][] calib, double[][] test) { double ret = 0.0; double N = 0.0; for (int i = 0; i < calib.length; i++) { for (int j = 0; j < calib[i].length; j++) { N += calib[i][j]; ret += Math.abs(calib[i][j] - test[i][j]...
d95912af-3e99-417f-b027-ec626232f955
@Override public String testName() { return "Cell Percentage Error"; }
326b0dc5-a017-4dfa-83b3-88ce69966f0c
@Override public String fieldName() { return "CPE"; }
9c4e5d95-1f11-449e-b0a4-0fbdc26f12ee
@Override public boolean calibrateToLessThan() { return true; }
5b6f6cba-6373-45f3-b452-459e0e20908f
@Override public boolean isPerfect(double testStat) { if (testStat == 0.0) { return true; } else { return false; } }
a016b411-8696-40c2-8eae-bd9289db8f98
public static double calcZScore(double T, double P, double N){ double pij = P / N; double tij = T / N; double numerator = 0.0; //if pij = 0 then the pij value in the denominator is altered to be a //suitably small value 1/N. if ( pij == 0 ){ pij = 1 / N; ...
79bc20a7-3b0c-4129-b082-d7cbb9462b39
public abstract void mutate();
a42804a9-9fdd-4907-9e54-fd705893a427
@Override public abstract String toString();
3c74d2f5-f276-4d6c-89b6-b819f433a43f
@Override public abstract boolean equals(Object o);
4e223f62-2e2c-49d6-a58f-104d63eb0f1e
@Override public abstract Gene clone();
a855b42a-76c5-4b5c-8920-f02f177b2462
@Override public abstract int hashCode();
40294bb1-d83b-4f9f-ae3d-a03df89b2d18
public void catchError(Exception e);
7192a9eb-8da6-4965-912d-2c2647fee295
protected Chromosome(){}
d89b2f20-2cf7-4328-bf0b-0e2b8f2bb008
protected Chromosome(GeneticAlgorithm parent){ this.parent = parent; }
e3beb8db-b578-4e13-a06f-726d1be4de88
protected Chromosome(GeneticAlgorithm parent, ArrayList<Gene> genes){ this.parent = parent; this.genes = genes; }
ae347f4b-7815-4878-96b9-fc6bb0fc1114
Chromosome breed(Chromosome partner) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException{ int min = genes.size(); int max = genes.size(); if( partner.getGenes().size() > min ){ max = partner.getGen...
e825559e-27d8-49e3-a575-156c620e141b
double getFitness(){ if ( fitness==null ){ fitness = new Double(calculateFitness(parent.getGof())); } return fitness.doubleValue(); }
40205f3d-aa06-4e3d-8e2d-825c9dc5d861
protected Chromosome createNewChromosome(GeneticAlgorithm parent) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{ Class[] parameterDefinition = {parent.getClass()}; Object[] parameter = {parent}; ...
d9cf66dd-6dcd-487d-a3a4-f88e53cb95b8
protected abstract void populateGenes();
c51221f8-b101-49fa-9472-277363a0c9b8
public abstract double calculateFitness(IGOF gof);
bda0ab9c-8559-4aab-b779-cf29798f66e2
public void mutate(){ if (!genes.isEmpty()){ genes.get( parent.getRandom().nextInt( genes.size() ) ).mutate(); } }
9d36bf04-28de-456a-b966-8303b692db6c
public ArrayList<Gene> getGenes(){ return genes; }
33baff13-ec8b-4504-9e4e-c035b7e15a2e
@Override public String toString(){ String s = "Genes: "; for (Gene e : genes) { s+=e.toString()+" "; } s+= "Fitness: "+getFitness(); return s.trim(); }
66e05ad4-65e6-48c3-a20c-047a7bb8d5c0
@Override public boolean equals(Object o){ //set up a boolean to track if the objects are the same boolean same = true; //check if we a comparing a Chromosome object if ( o instanceof Chromosome ){ //get the array of Genes from the object passed in ArrayList<G...
21f5fc3b-f9bb-4b75-981f-ae4d79ae685b
private Chromosome instantiateNewChromosomeSubObject(Class[] parameterDefinition, Object[] parameters) throws NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{ //get the Class of this sub class C...
139d3c51-6e43-48a7-b401-d46c46d78453
@Override public int hashCode() { int hash = 5; hash = 47 * hash + Objects.hashCode(this.genes); return hash; }
ccdab1f6-2088-486d-b4e7-3f513257c1e1
private GeneticAlgorithm(){}
f35e8169-dc18-4d63-bcf7-1fe7f8280f9d
public GeneticAlgorithm(Chromosome chromosome){ random = new Random(); this.chromosome = chromosome; }
30ff4969-8e43-4be1-81ca-e6800df34ac5
public GeneticAlgorithm(Chromosome chromosome, long seed){ this(chromosome); random = new Random(seed); }
b5793d81-853f-46b9-8e18-01521a5e2ec2
@Override public void run(){ //create the initial candidate population //if there is an error report it and end. for (int i = 0; i < candidatePopulationSize; i++) { try{ candidatePopulation.add(chromosome.createNewChromosome(this)); }catch(Exc...
a1f451b9-2610-4b4a-9121-cc43e6fb7e78
public Random getRandom() { return random; }
f30f248e-98c6-445b-9a28-f971a96cfa83
public int getGenerations() { return generations; }
4d7d01c1-e4b0-4d35-9033-5b14d766bec0
public void setGenerations(int generations) { this.generations = generations; }
4cd279a7-98d6-45f4-adb9-e77e211d57a8
public int getBreedPopulationSize() { return breedPopulationSize; }
150d872f-b2dd-4802-b472-457f20452b6e
public void setBreedPopulationSize(int breedPopulationSize) { this.breedPopulationSize = breedPopulationSize; }
5612a808-8952-43f1-8ae0-4a9b56cbc48e
public int getCandidatePopulationSize() { return candidatePopulationSize; }
bda1bdfa-be52-40dc-8802-7b25313e9fe1
public void setCandidatePopulationSize(int candidatePopulationSize) { this.candidatePopulationSize = candidatePopulationSize; }
c34cc783-41dd-45a3-994b-a76981b7ec6e
public double getMutationRate() { return mutationRate; }
370f064a-7e17-4e6f-98e9-830cf4dcd897
public void setMutationRate(double mutationRate) { this.mutationRate = mutationRate; }
cd56ad20-ccb2-4f8e-ba62-e9f9101e98ca
public IGOF getGof() { return gof; }
37beda5c-fa07-4513-95c7-d93d1dce7836
public void setGof(IGOF gof) { this.gof = gof; }
9bb21383-43df-42e6-bbe1-df8dbd5c2845
private void reportError(Exception e){ if ( errorListeners.isEmpty() ){ Logger.getGlobal().log(Level.SEVERE, e.getMessage()); }else{ for (IErrorListener listener : errorListeners) { listener.catchError(e); } } }
2b9d5505-c87d-44c1-aa3d-2dc7c6403c05
public void addErrorListener(IErrorListener listener){ this.errorListeners.add(listener); }