Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement the Automaton class in the header file using the functions in the given spec sheet.Implementation Specifications & Notes _ - num _ parents is
Implement the Automaton class in the header file using the functions in the given spec sheet.Implementation Specifications & Notes
numparents is the number of parents this Automaton considers or
Automaton: :extremebit
Automaton: :Automatonsizet numparents, sizet rule
Set extremebit to
Note you can but don't have to do all of this via a member initialization list. Thanks to the compiler flags we'r using, you'll probably
bool Automaton: : setrulesizet rule
You can assume or rather, you should ensure because you're also coding the constructor that when this method is invoked, the numparents member of the current object will already be set. Check its value, and if it is greater than permitted by MAXPARENTS, return false.
Furthermore, you should also return false if the rule value is greater than the maximum permitted by the numparents value. What is that value? How many rules does a particular number of parents allow?
Return false also if there is an even number of parents.
In short, this function will ensure that the Automaton object is valid, and return fal. constructor if it is not. The constructor, in turn, can set the isvalid attribute.
Otherwise, fill in the rules vector of the current object with the appropriate values for the given rule and return true. You can also assume or again, ensure that the vector would already have been sized correctly in the constructor.
bool Automaton: : equalsconst Automaton& that
This function should return true if the this Automaton is equal to that Automaton
They are both invalid.
bool Automaton: :makenextgenconst std: :vector&$&:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started