Browse Source

prints for foxGlynn

tempestpy_adaptions
Timo Philipp Gros 7 years ago
parent
commit
e5f71aa851
  1. 6
      src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp

6
src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp

@ -194,6 +194,7 @@ namespace storm {
} }
logfile << "Iteration for N = " << N << " maximal difference was " << diff << "\n"; logfile << "Iteration for N = " << N << " maximal difference was " << diff << "\n";
logfile << "vd: \n"; logfile << "vd: \n";
for (uint64_t i =0 ; i<unifVectors[0].size(); i++){ for (uint64_t i =0 ; i<unifVectors[0].size(); i++){
for(uint64_t j=0; j<unifVectors[0][i].size(); j++){ for(uint64_t j=0; j<unifVectors[0][i].size(); j++){
@ -650,7 +651,7 @@ namespace storm {
// calculate poisson distribution // calculate poisson distribution
storm::utility::numerical::FoxGlynnResult<ValueType> foxGlynnResult = storm::utility::numerical::foxGlynn(lambda*T, epsilon*kappa);
storm::utility::numerical::FoxGlynnResult<ValueType> foxGlynnResult = storm::utility::numerical::foxGlynn(lambda*T, epsilon*kappa/100);
// Scale the weights so they add up to one. // Scale the weights so they add up to one.
for (auto& element : foxGlynnResult.weights) { for (auto& element : foxGlynnResult.weights) {
@ -660,6 +661,8 @@ namespace storm {
ValueType sum = 0; ValueType sum = 0;
for (auto i = foxGlynnResult.left ; i<=foxGlynnResult.right; i++){ for (auto i = foxGlynnResult.left ; i<=foxGlynnResult.right; i++){
sum+=foxGlynnResult.weights[i-foxGlynnResult.left]; sum+=foxGlynnResult.weights[i-foxGlynnResult.left];
logfile << i << "\t" << foxGlynnResult.weights[i-foxGlynnResult.left];
logfile << i << "\t" << sum;
} }
std::cout << " left " << foxGlynnResult.left << " right " << foxGlynnResult.right << " size " << foxGlynnResult.weights.size() << " sum " << sum << "\n"; std::cout << " left " << foxGlynnResult.left << " right " << foxGlynnResult.right << " size " << foxGlynnResult.weights.size() << " sum " << sum << "\n";
@ -706,6 +709,7 @@ namespace storm {
} }
} }
oldDiff = maxNorm; oldDiff = maxNorm;
std::cout << "Finished Iteration for N = " << N << " with difference " << maxNorm << "\n";
} while (maxNorm > epsilon * (1 - kappa)); } while (maxNorm > epsilon * (1 - kappa));
logfile.close(); logfile.close();

Loading…
Cancel
Save