Browse Source

added 'superclass' for PRISM program and JANI model so they can be handled as symbolic model descriptions

Former-commit-id: 748069c151 [formerly 2c3e462958]
Former-commit-id: e8d3ceb693
tempestpy_adaptions
dehnert 8 years ago
parent
commit
7c9c55b09c
  1. 45
      src/storage/SymbolicModelDescription.cpp
  2. 35
      src/storage/SymbolicModelDescription.h

45
src/storage/SymbolicModelDescription.cpp

@ -1,9 +1,36 @@
//
// SymbolicModelDescription.cpp
// storm
//
// Created by Christian Dehnert on 09/09/16.
//
//
#include "SymbolicModelDescription.hpp"
#include "src/storage/SymbolicModelDescription.h"
#include "src/utility/macros.h"
#include "src/exceptions/InvalidOperationException.h"
namespace storm {
namespace storage {
SymbolicModelDescription::SymbolicModelDescription(storm::jani::Model const& model) {
// Intentionally left empty.
}
SymbolicModelDescription::SymbolicModelDescription(storm::prism::Program const& program) {
// Intentionally left empty.
}
bool SymbolicModelDescription::isJaniModel() const {
return modelDescription.which() == 0;
}
bool SymbolicModelDescription::isPrismProgram() const {
return modelDescription.which() == 1;
}
storm::jani::Model const& SymbolicModelDescription::asJaniModel() const {
STORM_LOG_THROW(isJaniModel(), storm::exceptions::InvalidOperationException, "Cannot retrieve JANI model, because the symbolic description has a different type.");
return boost::get<storm::jani::Model>(modelDescription);
}
storm::prism::Program const& SymbolicModelDescription::asPrismProgram() const {
STORM_LOG_THROW(isPrismProgram(), storm::exceptions::InvalidOperationException, "Cannot retrieve JANI model, because the symbolic description has a different type.");
return boost::get<storm::prism::Program>(modelDescription);
}
}
}

35
src/storage/SymbolicModelDescription.h

@ -1,14 +1,27 @@
//
// SymbolicModelDescription.hpp
// storm
//
// Created by Christian Dehnert on 09/09/16.
//
//
#pragma once
#ifndef SymbolicModelDescription_hpp
#define SymbolicModelDescription_hpp
#include <boost/variant.hpp>
#include <stdio.h>
#include "src/storage/jani/Model.h"
#include "src/storage/prism/Program.h"
#endif /* SymbolicModelDescription_hpp */
namespace storm {
namespace storage {
class SymbolicModelDescription {
public:
SymbolicModelDescription(storm::jani::Model const& model);
SymbolicModelDescription(storm::prism::Program const& program);
bool isJaniModel() const;
bool isPrismProgram() const;
storm::jani::Model const& asJaniModel() const;
storm::prism::Program const& asPrismProgram() const;
private:
boost::variant<storm::jani::Model, storm::prism::Program> modelDescription;
};
}
}
Loading…
Cancel
Save