private bool defualtRule(State state, InsertElement el)
{
if ((el.Mode & PlaceMask) == (UInt16)InsertMode.OldPlace)
{
if (state.NodeCount == 0)
{
//throw new TrainException(el, "Existed Node is not found, rule failed");
return false;
}
//LEVEL judgement
if ((el.Mode & LevelMask) == (UInt16)InsertMode.ExactlyLevel && el.Level != LEVEL.Uncertainty)
{
if (el.Level < state.MinStateLEVEL || el.Level > state.MaxStateLEVEL)
{
//throw new TrainException(el, "Existed Node is not found, rule failed");
return false;
}
}
//LEVEL judgement
//if ((el.Mode & LevelMask) == (UInt16)InsertMode.DegradeLevel && el.Level != LEVEL.Uncertainty)
//{
// if (el.Level < state.MinStateLEVEL)
// {
// //throw new TrainException(el, "Existed Node is not found, rule failed");
// return false;
// }
//}
////LEVEL judgement
//if ((el.Mode & LevelMask) == (UInt16)InsertMode.UpgradeLevel && el.Level != LEVEL.Uncertainty)
//{
// if (el.Level > state.MaxStateLEVEL)
// {
// //throw new TrainException(el, "Existed Node is not found, rule failed");
// return false;
// }
//}
}
else if ((el.Mode & PlaceMask) == (UInt16)InsertMode.NewPlace)
{
}
else if ((el.Mode & PlaceMask) == (UInt16)InsertMode.AutoPlace)
{
}
return true;
}