Homework 6. Choose a language for a flynetting swarm Solution

$35.00 $29.05

You'll get a: . zip file solution, download link after Payment

Description

[131 home > Homework]

Motivation

You’re working for XuFly, a startup company that intends to build swarms of tiny flying robots that will kill insects. The robots are intended for use in areas like farmers’ markets where swarms of insects are common and where conventional chemical treatments are not allowed. The idea is that each swarm of robots will be equipped with nets that capture flying insects. A planned, more-advanced version of the robot swarms will sport flyswatters to handle insects that are not flying.

Your boss has assigned you the job of writing the code that runs in the robots. The robots’ processors will be equipped with low-power CPUs and AI accelerators to implement the algorithms to recognize flying insects (and eventually, stationary insects) and to control the robots’ actions. Robot swarms will divide, merge, and collaborate as necessary to control insects as efficiently as possible. When a robot runs low on power it will fly to a charging station and charge itself back up.

The code that you’re in charge of will need to operate many algorithms, some involving machine-learning-based recognition and some involving cooperation. For example, your boss is interested in having you try the swarm gradient bug algorithm (SGBA). See: McGuire KN, De Wagter C, Tuyls K, Kappen HJ, de Croon GCHE. Minimal navigation solution for a swarm of tiny flying robots to explore an unknown environment. Sci Robot. 2019;4(35):eaaw9710. doi:10.1126/scirobotics.aaw9710.

Your company has previously prototyped robots by writing C++ code, but this effort has had the usual problems with buggy programs containing invalid address, race conditions, and the like, and your boss is interested in possibly choosing a better language for this set of applications since you’ll need to write these applications from scratch – or maybe you’ll just stick with C++. Also, your company would like to choose hardware that is cost-effective and cheap, and wants the ability to switch suppliers between one robot model and the next; it would not like to be tied down to any particular supplier due to its choice of programming language.

Here are some potential technologies that your company may use, and would like your language choice to work well with:

Assignment

Review the abovementioned sources, and any other that seem relevant for this application, and compare and contrast the following languages as candidates for the code that XuFly will write for its flying robots:

  • C++

  • Go

  • Java

  • Python

You already know C++, Java and Python from previous classes or assignments. Familiarize yourself with Go enough to write and test a simple function everyNth that accepts a list L and a positive integer N and returns a new list containing every Nth element of L, starting with the (N−1)st (counting from zero) element, then the (2N−1)st element, and so on until L’s elements are exhausted so that the returned list’s size is ⌊len(L) / N⌋ (where ⌊x⌋ is the floor of x). The method should accept any list and should consume O(len(L)) time and O(len(L)/N) space. Put your function into a file everyNth.go that tests your function on a list of the first 1000 nonnegative integers and on an N equal to 109, and which prints the integers in the resulting list, one per line. The shell command go build && ./everyNth should test your program.

Do some research on your four languages and support software as a potential platform. Your research should include an examination of the language and system documentation to help determine whether it would be effective. We want an alternative that supports the proposed application well.

We are not expecting working prototypes for the proposed application.

Write an executive summary that compares the four alternate approaches to each other. The summary should be in 10-point font or larger and should be at most three pages. You can put references and appendixes in later pages, if you can’t get under the page limit otherwise: the appendixes should contain any source code or diagrams. Your summary should focus on the technologies’ effects on ease of use, flexibility, generality, performance, reliability; thie idea is to explore the most-important technical challenges in doing the proposed rewrite. The summary should be suitable for software executives, that is, for readers who have some expertise in software, particularly in managing software developers, but who are not experts in the languages. Please keep the resources for written reports and oral presentations in mind, particularly its rubrics and its advice for citations to sources that you consulted.

Submit

Submit a file hw6.pdf containing your summary. Submit your everyNth implementation and test, along with any other prototype code, as a compressed tarball hw6.tar.gz in the usual way. Your tarball should include a simple Makefile such that the command make check builds and runs your test case. You can augment the makefile to build and run any other prototype code you submit.