Answered step by step
Verified Expert Solution
Link Copied!

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
_-num_parents is the number of parents this Automaton considers (1,3 or 5),
Automaton: :_extreme_bit
Automaton: :Automaton(size_t num_parents, size_t rule)
Set _extreme_bit to 0.
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: : set_rule(size_t rule)
You can assume (or rather, you should ensure because you're also coding the constructor) that when this method is invoked, the _num_parents member of the current object will already be set. Check its value, and if it is greater than permitted by MAX_PARENTS, return false.
Furthermore, you should also return false if the rule value is greater than the maximum permitted by the __num_parents 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 _is_valid 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: : equals(const Automaton& that)
This function should return true if the ** this Automaton is equal to that Automaton
They are both invalid.
bool Automaton: :make_next_gen(const std: :vector&$&=1{1}:'20=1n
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions