1
2.0kviews
A Lunar Lander game is to be developed with following specifications: User input- It takes input from pilot as increase/decrease speed which is directly mapped to required burn rate

Other inputs- Lunar Lander has two sensors i. Current Burn Rate ii. Current Altitude Output- Based on the 3 inputs determine new burn rate and set different parameters like altitude, velocity etc. and display them. Draw an architecture using any of the two style: a) Object Oriented Style b) Rule Based Style c) Black Board Style

Mumbai University > Computer engineering > Sem 7 > Software Architecture.

Marks: 20 M

Year: May 13

1 Answer
0
21views

Object Oriented Style: Here the states are strongly encapsulated with functions that operate on that state as objects.

The architecture for a Lunar Lander game in object oriented style is given as:

enter image description here

It has 3 encapsulations- the spacecraft, user interface and environment. Here, the interaction with the user is handled by a single object which performs both input and output functions.The GUI component can display the status of the spacecraft and get any information from spacecraft like burnRate.

The spacecraft component can set and get values of altitude, fuel, time, velocity and mass. The environment simulator calculates the status of the spacecraft.

Rule Based Style: Here the inference engine parses user input and determines whether it is a fact/rule or query. It adds the entry to the knowledge base if it is a fact else it queries the knowledge base for applicable rules and attempts to resolve the query.

The designing of Lunar Lander requires thinking of the problem as one of maintaining a set of consistent facts about the spacecraft. E.g.the passage of one second of time demands that the facts regarding amount of remaining fuel, velocity of spacecraft and height of spacecraft be brought up to date consistently.

The architecture for a Lunar Lander game in rule based style is given as:

enter image description here

With regard to user interaction model, the user enters the value of burn rate as a fact- burn Rate. To see the status of spacecraft, user can switch to goal mode and ask whether spacecraft has landed safely. The inference engine queries the database to find the result. If the existing facts satisfy the conditions “altitude<=0” and “velocity< 3ft/s” then engine returns true to the user else it returns false.

Black Board Style: Here independent programs access and communicate exclusively through a global data repository known as blackboard.

The architecture for a Lunar Lander game in blackboard style is given as:

enter image description here

A single connector regulates access from the various experts in manipulating the information on the blackboard. The blackboard maintains the game state. The experts perform the independent tasks of

  1. Updating the engine burn rate depending upon the input from user
  2. Displaying to the user the current state of spacecraft
  3. Updating the game state based upon a time and physics model
Please log in to add an answer.