Difference between revisions of "MemEOL"

From Desal Wiki
Line 47: Line 47:
 
}
 
}
  
function computeTotalScore(){
+
*/
  
 +
function computePreferenceScores(preferences){
 +
        console.log("preferences: " + String(preferences));
 +
        var arrayLength = preferences.length;
 +
        var centroidWeights = new Array(arrayLength);
 +
        for (var i=0; i < arrayLength; i++) {
 +
            centroidWeights[preferences[i]-1] = centroidWeightMagicNumbers[i+1];
 +
            console.log(String(preferences[i]-1) + " | " + String(centroidWeightMagicNumbers[i+1]));
 +
        }
 +
        //now multiply each centroid weight by each magic number to get scores
 +
        var j=0;
 +
        var scores= new Array();
 +
        for (var item in dictionaryMagicNumbers) {
 +
            if(item == 'Options') continue;
 +
            var k=0;
 +
            scores[j]=0;
 +
            for (var subItem in dictionaryMagicNumbers[item]) {
 +
                console.log(String(item) + " - " + String(j) +"-" + String(k) +": "+ String(dictionaryMagicNumbers[item][subItem]) +" | "+ String(centroidWeights[k]));
 +
                scores[j] = scores[j] + centroidWeights[k] * dictionaryMagicNumbers[item][subItem];
 +
                k++;
 +
            }
 +
            console.log('Score: ' + String(scores[j]));
 +
            j++;
 +
        }
 +
        //now that we have the scores we need to check them and display the correct output
 
}
 
}
  
function computeCentroidWeight(){
 
 
}
 
 
*/
 
 
//prefereces are coded to be 0-4 not 1-5
 
//prefereces are coded to be 0-4 not 1-5
 
function getPreferences(){
 
function getPreferences(){
Line 85: Line 104:
 
       .click(function( event ) {
 
       .click(function( event ) {
 
       event.preventDefault(); //lock the button for now.
 
       event.preventDefault(); //lock the button for now.
        var preferences = getPreferences();
 
        console.log("preferences: " + String(preferences));
 
        var arrayLength = preferences.length;
 
        var centroidWeights = new Array(arrayLength);
 
        for (var i=0; i < arrayLength; i++) {
 
        centroidWeights[preferences[i]-1] = centroidWeightMagicNumbers[i+1];
 
        console.log(String(preferences[i]-1) + " | " + String(centroidWeightMagicNumbers[i+1]));
 
        }
 
        //now multiply each centroid weight by each magic number to get scores
 
        var j=0;
 
        var scores= new Array();
 
        for (var item in dictionaryMagicNumbers) {
 
        if(item == 'Options') continue;
 
        var k=0;
 
        scores[j]=0;
 
  for (var subItem in dictionaryMagicNumbers[item]) {
 
  console.log(String(item) + " - " + String(j) +"-" + String(k) +": "+ String(dictionaryMagicNumbers[item][subItem]) +" | "+ String(centroidWeights[k]));
 
    scores[j] = scores[j] + centroidWeights[k] * dictionaryMagicNumbers[item][subItem];
 
    k++;
 
}
 
console.log('Score: ' + String(scores[j]));
 
j++;
 
}
 
//now that we have the scores we need to check them and display the correct output
 
  
 +
                var preferences = getPreferences();
 +
                var scores = computePreferenceScores(preferences);
 
       });
 
       });
 
   });
 
   });

Revision as of 06:16, 8 December 2014

Introduction text

Do you suspect there is any physical damage to the membranes that would prevent them from being reused?

What is the tested permeability of your membranes (LMH/bar)?

What is the tested NaCl rejection of your membranes? (% NaCl rejection)


Please order the following criteria in the order of importance for your project (drag and drop):

  • Financial
  • Effort required
  • Environmental impact
  • Landfill impact
  • Public perception
Most important Least important