Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python help pleaseee Problem While developing solutions of new technologies, engineers are faced with balancing trade-offs in their design. For example, in designing a car,

python help pleaseee
image text in transcribed
image text in transcribed
image text in transcribed
Problem While developing solutions of new technologies, engineers are faced with balancing trade-offs in their design. For example, in designing a car, reducing the size can increase fuel efficiency but resalt is lower crash safety ratings. Computer scientists and software engineers typically need to balanee the speed of their programs with the amount of memory they reqaire to execute. One way to approach these trade-offs is to define some constraints and then optimize the design within those constraints. In our car design example, we could define a minimum safety rating and then design the car to maximize fuel efficiency while still mecting our minimum safety rating. In this week's lab, you will be writing a function that will check whether a design meets a particular constraint. For our problem, we will imagine we are designing the layout of a wind farm and are trying to identify where to place hundreds of turbines'. We want to optimize turbine placement to maximize energy generation while adhering to land use constraints. These constraints define areas where turbines cannot be placed. These constraints come from land rights, proximity to other turbines, and regulations regarding turbine proximity to human housing and natural habitats. You will write a function named rectangle_overlap which will analyne whether two rectangles overlap in two-dimensional space. In eases where the rectangles overlap, your function will determine the nature of the overlap (details below). In the coetext of cur problem, these rectangles can be thought of as a restricted area and a proposed turbine site. The output of the function will tell us whether the proposed location meets the constraints. Each of the rectangles input to the function will be defined by two points the botiom left corner and the top right comer (see figure 1). Figure 1. A rectangle can be defined with two non-adjacent corners. In this case, we are given the bottom left and top right corners. Because the angles at each corner are 90, the other two points can be calculated using the given points. Deliverables For this lab, you must submit a function rectangle_overlap within a single file named "lab4.py' to MarkUS by the posted deadline. Five test cases are provided on MarkUs to help you prepare your solution. Passing all these test cases does not guarantee your code is correct. You will need to develop your own test cases to verify your solution works cotrectly. Your programs will be graded using ten secret test cases. These test cases will be released after the assignment deadline. IMPORTANT: - Do not change the file name or function names - Do not use inpat() inside your program The rectangle_overlap function will accept the following inputs: The function will output one of the five following strings describing the overlap of the two rectangles: understanding. Note images are not to scale

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago