提供高质量的essay代写,Paper代写,留学作业代写-天才代写

首頁 > > 詳細

代寫Web開發|代寫R語言編程|代寫Web開發|代做R語言程序

Assignment
4
Due date: 24 May at midnight
Topic: Solving Mailbox overflow [Total Marks: 100]
In this project you are required to edit the code of Cakes in order to solve the problem of Mailbox
overflow. You need to implement a very precise specification.
Task1
[20 Marks]
Understand and explain the given code
In your report, explain how the various classes and methods inside Cakes work.
This includes Alice, Bob, Charles, Tim, OpenAkka, AkkaConfig and Cakes: the class containing
the main method.
We expect about 1 page of text.
Task2
[50 Marks]
Solving Mailbox Overflow
Following very closely the specification below edit the file Cakes.java:
Alice, Bob and Charles are Producers.
A Producer has a list of stored products, has a maximum size of the list of products,
and can be in running or non-running state.
A Producer knows how to answer to three messages: T, MakeOne and GiveOne.
Here is how a Producer needs to answer those messages.
?
T (a product):
? just add it to the list of products (thus, it can go over the limit).
?
MakeOne, when the list is full (the size is at or over the maximum size limit):
? sets the state to not-running.
?
MakeOne, when the list is not full:
? pipes a future product to self;
? when the future product is completed, tell MakeOne to self.
?
GiveOne, when the list is empty:
? pipes a future product to the sender.
?
GiveOne, when the list is not empty:
? removes a product from the list and tell that product to the sender.
?
(additionally) GiveOne when the state is not-running and the list is not full:
? set the state as running;
? tell MakeOne to self.
To answer those messages, a Producer can make future products.
(Since Actors need non-blocking computation, what kind of Future should it be?)
The computation actually making the product could be very long, and thus it must be asynchronous
with respect to the Producer actor, so that they will be able to keep answering other messages.
In more detail: Alice and Bob will just make Wheat and Sugar; Charles will ask Alice and Bob
for Wheat and Sugar, he will then combine the ingredients to produce a future Cake.
Tim now needs to ask Charles for cakes.
The overall process should keep the same behavior as before.
Edit the file Cakes.java:
?
Introduce an abstract actor Producer, with an abstract make() method.
?
Alice, Bob and Charles now extend Producer and implement make().
?
Tim code is adapted as needed.
?
The method Cakes.computeGift(int) can be adapted, for example to satisfy different
constructors for Charles and Tim.
?
The code as a whole keeps the same behavior as before. In particular, it can still
transparently run on a single machine or on many machines.
NOTE:
Producing cakes with sugar and wheat is, of course, just a metaphor to represent some complex
computation that needs to be performed by the various actors.
To respect this metaphor, only code under the control of Alice can produce Wheat.
In the same way, only Bob can produce Sugar, and only Charles can produce Cakes. Those cakes
must be produced using the Wheat and Sugar objects created by Alice and Bob.
A solution that breaks the metaphor, where for example Charles makes also the Wheat and the
Sugar is invalid and will not receive many marks. If you 'just try to make your code compile' you
are likely to break the metaphor.
Task3
[30 Marks]
Load balancing on multiple machines
?
Edit the class Sugar so that it now takes at least 200 milliseconds to create a Sugar
instance.
?
Then, modify Cakes so that 4 copies of Bob (the Sugar producer) are used, and reside on 4
different machines.
?
Edit the main method to instantiate those 4 Bobs and edit Charles so that he takes
advantage of the 4 Bobs.
?
In the report, describe the improvement in performance between the solution with 1 Bob
and the solution with 4 Bobs; briefly describe how you measured the performance
difference.
TO SUBMIT:
Your submission should include:
1. A jar file with all your code for Task2, without the tweaks of Task3.
Thus Task2 can be marked independently of your performance while encoding Task3.
2. A jar file with all your code for Task3, including an option to run with 1 Bob or with 4 Bobs.
This means you will submit a fair amount of duplicated code that is common for Task2 and
3.
3. Your report in pdf format
4. A txt file stating any bugs in your code and how to run your code (i.e. a readme file)

聯系我們
  • QQ:1067665373
  • 郵箱:1067665373@qq.com
  • 工作時間:8:00-23:00
  • 微信:Badgeniuscs
熱點文章
程序代寫更多圖片

聯系我們 - QQ: 1067665373 微信:Badgeniuscs
? 2021 uk-essays.net
程序代寫網!

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack 北美最专业的线上写作专家:网课代修,网课代做,CS代写,程序代写 代码代写,CS编程代写,java代写北美最好的一站式学术代写服务机构 美国essay代写,作业代写,✔美国网课代上-最靠谱最低价 美国代写服务,作业代写,CS编程代写,java代写,python代写,c++/c代写 代写essay,作业代写,金融代写,business代写-留学生代写平台 北美代写,美国作业代写,网课代修,Assignment代写-100%原创 北美作业代写,【essay代写】,作业【assignment代写】,网课代上代考