STORM_LOG_THROW(distribution==Distribution::None,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
firstValDistribution=result.second;
distribution=Distribution::Constant;
}
// Exponential distribution
result=parseValue("lambda",line,valueParser);
if(result.first){
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Erlang,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Erlang,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Exponential,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Exponential,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
erlangPhases=resultNum.second;
distribution=Distribution::Erlang;
}
// Weibull distribution
result=parseValue("rate",line,valueParser);
if(result.first){
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Weibull,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Weibull,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
firstValDistribution=result.second;
distribution=Distribution::Weibull;
}
result=parseValue("shape",line,valueParser);
if(result.first){
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Weibull,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::Weibull,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
secondValDistribution=result.second;
distribution=Distribution::Weibull;
}
// Lognormal distribution
result=parseValue("mean",line,valueParser);
if(result.first){
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::LogNormal,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::LogNormal,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
firstValDistribution=result.second;
distribution=Distribution::LogNormal;
}
result=parseValue("stddev",line,valueParser);
if(result.first){
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::LogNormal,storm::exceptions::WrongFormatException,"A different distribution was already defined for this basic element.");
STORM_LOG_THROW(distribution==Distribution::None||distribution==Distribution::LogNormal,storm::exceptions::WrongFormatException,"A different distribution was already defined for basic element '"<<name<<"' in line "<<lineNo<<".");
secondValDistribution=result.second;
distribution=Distribution::LogNormal;
}
// Additional arguments
result=parseValue("cov",line,valueParser);
if(result.first){
STORM_LOG_WARN("Coverage is not supported and will be ignored.");
STORM_LOG_WARN("Coverage is not supported and will be ignored for basic element '"<<name<<"' in line "<<lineNo<<".");
}
result=parseValue("res",line,valueParser);
if(result.first){
STORM_LOG_WARN("Restoration is not supported and will be ignored.");
STORM_LOG_WARN("Restoration is not supported and will be ignored for basic element '"<<name<<"' in line "<<lineNo<<".");
}
resultNum=parseNumber("repl",line);
if(resultNum.first){
replication=resultNum.second;
STORM_LOG_THROW(replication==1,storm::exceptions::NotSupportedException,"Replication > 1 is not supported.");
STORM_LOG_THROW(replication==1,storm::exceptions::NotSupportedException,"Replication > 1 is not supported for basic element '"<<name<<"' in line "<<lineNo<<".");
}
result=parseValue("interval",line,valueParser);
if(result.first){
STORM_LOG_WARN("Interval is not supported and will be ignored.");
STORM_LOG_WARN("Interval is not supported and will be ignored for basic element '"<<name<<"' in line "<<lineNo<<".");
STORM_LOG_THROW(false,storm::exceptions::WrongFormatException,"Unknown arguments for basic element '"<<name<<"' in line"<<lineNo<<": "<<line);
}
switch(distribution){
caseConstant:
STORM_LOG_THROW(false,storm::exceptions::NotSupportedException,"Constant distribution is not supported.");
STORM_LOG_THROW(false,storm::exceptions::NotSupportedException,"Constant distribution is not supported for basic element '"<<name<<"' in line "<<lineNo<<".");
break;
caseExponential:
returnbuilder.addBasicElement(parseName(name),firstValDistribution,dormancyFactor,false);// TODO set transient BEs
@ -307,7 +307,7 @@ namespace storm {
}else{
// Model Erlang distribution by using SEQ over BEs instead.
// For each phase a BE is added, then the SEQ ensures the ordered failure.
STORM_LOG_WARN("Erlang distribution is modelled by SEQ gate and BEs.");
STORM_LOG_WARN("Erlang distribution for basic element '"<<name<<"' in line "<<lineNo<<"is modelled by SEQ gate and BEs.");
std::stringorigName=parseName(name);
std::vector<std::string>childNames;
boolsuccess=builder.addBasicElement(origName,firstValDistribution,dormancyFactor,false);// TODO set transient BEs
@ -325,16 +325,16 @@ namespace storm {
// Weibull distribution reduces to exponential distribution
returnbuilder.addBasicElement(parseName(name),firstValDistribution,dormancyFactor,false);// TODO set transient BEs
}else{
STORM_LOG_THROW(false,storm::exceptions::NotSupportedException,"Weibull distribution is not supported.");
STORM_LOG_THROW(false,storm::exceptions::NotSupportedException,"Weibull distribution is not supported for basic element '"<<name<<"' in line "<<lineNo<<".");
}
break;
caseLogNormal:
STORM_LOG_THROW(false,storm::exceptions::NotSupportedException,"LogNormal distribution is not supported.");
STORM_LOG_THROW(false,storm::exceptions::NotSupportedException,"LogNormal distribution is not supported for basic element '"<<name<<"' in line "<<lineNo<<".");
break;
caseNone:
// go-through
default:
STORM_LOG_THROW(false,storm::exceptions::WrongFormatException,"No distribution for basic element defined.");
STORM_LOG_THROW(false,storm::exceptions::WrongFormatException,"No distribution defined for basic element '"<<name<<"' in line "<<lineNo<<".");