Added rule to PDDL translator output to make all unspecified initial state variables false by default.
This commit is contained in:
parent
91019f52aa
commit
7bd483cd7e
@ -10,9 +10,6 @@
|
|||||||
% Establish initial state
|
% Establish initial state
|
||||||
holds(Variable, Value, 0) :- initialState(Variable, Value).
|
holds(Variable, Value, 0) :- initialState(Variable, Value).
|
||||||
|
|
||||||
% Make unspecified initial state variables false by default (for PDDL)
|
|
||||||
holds(variable(Variable), value(Variable, false), 0) :- variable(variable(Variable)), {initialState(variable(Variable), _)} 0.
|
|
||||||
|
|
||||||
#program step(t).
|
#program step(t).
|
||||||
|
|
||||||
% Perform actions
|
% Perform actions
|
||||||
|
@ -531,7 +531,17 @@ void TranslatorASP::translateInitialState() const
|
|||||||
m_outputStream << ").";
|
m_outputStream << ").";
|
||||||
});
|
});
|
||||||
|
|
||||||
m_outputStream << std::endl;
|
m_outputStream
|
||||||
|
<< std::endl << std::endl
|
||||||
|
<< utils::RuleName("initialState") << "("
|
||||||
|
<< utils::Keyword("variable") << "(" << utils::Variable("X") << "), "
|
||||||
|
<< utils::Keyword("value") << "(" << utils::Variable("X") << ", " << utils::Boolean("false") << ")) :- "
|
||||||
|
<< utils::RuleName("variable") << "(" << utils::Keyword("variable") << "(" << utils::Variable("X") << ")), "
|
||||||
|
<< utils::Keyword("not") << " "
|
||||||
|
<< utils::RuleName("initialState") << "("
|
||||||
|
<< utils::Keyword("variable") << "(" << utils::Variable("X") << "), "
|
||||||
|
<< utils::Keyword("value") << "(" << utils::Variable("X") << ", " << utils::Boolean("true") << "))."
|
||||||
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Reference in New Issue
Block a user