@ -338,28 +338,32 @@ int main(const int argc, const char* argv[]) {
model - > printModelInformationToStream ( std : : cout ) ;
// Enable the following lines to test the MinimalLabelSetGenerator.
if ( model - > getType ( ) = = storm : : models : : MDP ) {
std : : shared_ptr < storm : : models : : Mdp < double > > labeledMdp = model - > as < storm : : models : : Mdp < double > > ( ) ;
storm : : storage : : BitVector const & finishedStates = labeledMdp - > getLabeledStates ( " finished " ) ;
storm : : storage : : BitVector const & allCoinsEqual1States = labeledMdp - > getLabeledStates ( " all_coins_equal_1 " ) ;
storm : : storage : : BitVector targetStates = finishedStates & allCoinsEqual1States ;
std : : set < uint_fast64_t > labels = storm : : counterexamples : : MILPMinimalLabelSetGenerator < double > : : getMinimalLabelSet ( * labeledMdp , storm : : storage : : BitVector ( labeledMdp - > getNumberOfStates ( ) , true ) , targetStates , 0.4 , true , true ) ;
std : : cout < < " Found solution with " < < labels . size ( ) < < " commands. " < < std : : endl ;
for ( uint_fast64_t label : labels ) {
std : : cout < < label < < " , " ;
}
std : : cout < < std : : endl ;
}
// Enable the following lines to test the SMTMinimalCommandSetGenerator.
// if (model->getType() == storm::models::MDP) {
// std::shared_ptr<storm::models::Mdp<double>> labeledMdp = model->as<storm::models::Mdp<double>>();
// storm::storage::BitVector const& finishedStates = labeledMdp->getLabeledStates("finished");
// storm::storage::BitVector const& allCoinsEqual1States = labeledMdp->getLabeledStates("all_coins_equal_1");
// storm::storage::BitVector targetStates = finishedStates & allCoinsEqual1States;
// std::set<uint_fast64_t> labels = storm::counterexamples::SMTMinimalCommandSetGenerator<double>::getMinimalCommandSet(program, constants, *labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.4, true);
// std::set<uint_fast64_t> labels = storm::counterexamples::MILPMinimalLabelSetGenerator<double>::getMinimalLabelSet(*labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.4, true, true);
//
// std::cout << "Found solution with " << labels.size() << " commands." << std::endl;
// for (uint_fast64_t label : labels) {
// std::cout << label << ", ";
// }
// std::cout << std::endl;
// }
// Enable the following lines to test the SMTMinimalCommandSetGenerator.
if ( model - > getType ( ) = = storm : : models : : MDP ) {
std : : shared_ptr < storm : : models : : Mdp < double > > labeledMdp = model - > as < storm : : models : : Mdp < double > > ( ) ;
// storm::storage::BitVector const& finishedStates = labeledMdp->getLabeledStates("finished");
// storm::storage::BitVector const& allCoinsEqual1States = labeledMdp->getLabeledStates("all_coins_equal_1");
// storm::storage::BitVector targetStates = finishedStates & allCoinsEqual1States;
// std::set<uint_fast64_t> labels = storm::counterexamples::SMTMinimalCommandSetGenerator<double>::getMinimalCommandSet(program, constants, *labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.4, true);
storm : : storage : : BitVector const & collisionStates = labeledMdp - > getLabeledStates ( " collision_max_backoff " ) ;
storm : : storage : : BitVector const & deliveredStates = labeledMdp - > getLabeledStates ( " all_delivered " ) ;
std : : set < uint_fast64_t > labels = storm : : counterexamples : : MILPMinimalLabelSetGenerator < double > : : getMinimalLabelSet ( * labeledMdp , ~ collisionStates , deliveredStates , 0.5 , true , true ) ;
}
}
// Perform clean-up and terminate.