Browse Source
added 'superclass' for PRISM program and JANI model so they can be handled as symbolic model descriptions
added 'superclass' for PRISM program and JANI model so they can be handled as symbolic model descriptions
Former-commit-id:tempestpy_adaptions748069c151
[formerly2c3e462958
] Former-commit-id:e8d3ceb693
dehnert
8 years ago
2 changed files with 59 additions and 19 deletions
@ -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); |
|||
} |
|||
|
|||
} |
|||
} |
@ -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; |
|||
}; |
|||
|
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue