代做CS157B: Spring 2021 HW #2: Embedded Static & Dynamic SQL代写留学生Java程序

CS157B: Spring 2021 HW #2: Embedded Static & Dynamic SQL

This coursework is individual. While discussion among students about the coursework is encouraged each student should have a unique submission and be able to explain their code. If plagarism is suspected students will receive zero for the coursework. There are two options for the coursework.

Option 1:

The goal of this option is to add some functionality to handle networking and consistency issues in existing multiplayer games. You may select the game and language of your choice but please include the source of your game in your submission.

If you would like to use java as your language I would recommend using https://github.com/apetenchea/SpaceInvaders as your multiplayer game.

If you would like to use javascript. I would recommend using https://github.com/geckosio/phaser3-multiplayer-game-example as your multiplayer game.

Please feel free to share sources on the forum if you find something you think other students may find useful.

The additional functionality which should be added to the are as follows:

Introduce an artificial network delay to simulate some of the challenges which take place in networked games. This should vary over time to simulate real network conditions. Static network delay will be given partial marks.

Implement bucket sychronization so that all clients have the same frame. rate so the game can be considered “fair”

Implement interest management so that a large map exists on the primary copy of the game while information on objects which are sent to secondary copies should only contain information relavent to that client

Implement dead reckoning so that players continue to update in the event that network problems cause delays in updates received about player position

Implement smooth corrections so that players move towards the correct position after drops in network communication to prevent jerky animation

Introduce some form. of cheat which allows one client to perform. a game action that cannot be done by other clients. This can take multiple forms. One example would be to increase the movement speed of one player

Introduce some checking on the server side which allows the cheating to be detected. This cheating detection should be general rather than specific to how you implemented the cheat. E.g. If you implement a move cheat you should check for unrealistic movements in player position rather than looking for a specific function call.

There is a video on how to get started with the Java option that can be found at https://qmplus.qmul.ac.uk/mod/kalvidres/view.php?id=1560995. The deliverable is concerned with the design of the game. You are expected to upload one zip file containing all the source files for your coursework by 10am the 20th of April. You are also expected to upload a 5-10 minutes video of your code running and explain the features you implemented. This could be demonstrated in the application e.g. showing only some of the game sprites for Interest Management or via the code e.g. explaining the code that creates an artificial delay. There is a seperate link for video uploads that can be found at https://qmplus.qmul.ac.uk/mod/assign/view.php?id=1892626. Information on submitting a video assignment can be found at https://elearning.qmul.ac.uk/guide/submitting-a-video-assignment/Please note that the submission of a demonstration video is mandatory and failure to submit will result in zero marks. Both the code and video are required for the project.

The marks for this option are as follows:

Artificial Network Delay (4 marks)

Bucket Sychronization (6 marks)

Interest Management (6 marks)

Dead Reckoning (6 marks)

Smooth Corrections (6 marks)

Cheating (4 marks)

Cheating Detection (4 Marks)

Code Style. and Readability (4 marks)

(total 40 marks)

Option 2:

The goal of this option is to expand the work you have done in lab 1 and 2 to create a system which will allow the distributed processing of matrix calculations. The system should have the following features:

A REST interface that allows matricies to be uploaded as files. The files can be any format but I would recommend using the space character to seperate elements and new lines to seperate rows for simplicity. A guide on uploading files can be found at https://spring.io/guides/gs/uploading-files/. The component should be able to accept matricies of arbitrary size but you can assume they are square matricies whose dimensions are powers of 2 so you can use the divide and conquer approach utilized in lab 1. If a matrix is not this size the REST interface should throw an error. The REST interface should also have functionality to trigger the matrix multiplication and present the results. The gRPC client code should be integrated into the REST interface to call the addBlock and multBlock functions on the gRPC server. Partial marks will be awarded for matrix multiplication which does not allow matricies of an arbitrary size.

A gRPC server which provides access to the addBlock and multBlock functions. These functions should be able to accept any square matrix whose dimensions are powers of 2.

There should be multiple instantiations of the gRPC server. You should have at least eight gRPC servers threads. There are two ways to go about this. You could use a large instance with 8 cores e.g. a e2-standard-8 and configure the gRPC threading model to access each of these cores or you could have 8 small instances e.g. e2-micro and configure the gRPC client to spread the load among these servers. I would recommend the later. Please note that you should have sufficient credit for the module to implement the proposed system if you manage it correctly e.g. stop instances if you are not using them. Managing your credit is part of the challenge so requests for additional credit will not be entertained. The performance improvement via scaling is not quite linear (Adding needs to be done after multiplication) but you should see a signficant performance improvement as you add more gRPC servers.

Frequently large scale workloads use the notion of a deadline to determine how many servers should be assigned to a workload. Your system should have a deadline based scaling function. A footprinting function should be implemented to determine the time required for multiplying one block and this should be used to determine the minimal number of servers required to achieve the deadline. You can ignore the adding time for this component (this may lead to a workload exceeded the deadline which is fine).

The marks for this option are as follows:

REST Interface (10 marks)

gRPC Server (6 marks)

gRPC Scaling (10 marks)

gRPC Deadline Footprinting and Scaling (10 marks)

Code Style. and Readability (4 marks)

The deliverable is all the code used for your system. You are expected to upload one zip file containing all the source files for your coursework by the 10am the 20th of April. You are also expected to upload a 5-10 minutes video of your code running and explain the features you implemented. This could be demonstrated in the application e.g. showing a speedup when multiple gRPC server thread are used or via the code e.g. explaining the code that handles footprinting. There is a seperate link for video uploads that can be found at https://qmplus.qmul.ac.uk/mod/assign/view.php?id=1892626. Information on submitting a video assignment can be found at https://elearning.qmul.ac.uk/guide/submitting-a-video-assignment/Please note that the submission of a demonstration video is mandatory and failure to submit will result in zero marks. Both the code and video are required for the project.

Guidance for deadline based scaling

Last year a number of students had questions about how to implement deadline based scaling so I am including my advice here for clarity.

You will have multiple gRPC stubs which represent the server on the client side. In terms of code it will look something like this:

ManagedChannel channel1 = ManagedChannelBuilder.forAddress(“IP_ADDRESS_1”, 8080) .usePlaintext().build();

ManagedChannel channel2 = ManagedChannelBuilder.forAddress(“IP_ADDRESS_2”, 8080) .usePlaintext().build();

ManagedChannel channel3 = ManagedChannelBuilder.forAddress(“IP_ADDRESS_3”, 8080) .usePlaintext().build();

MatrixServiceGrpc.MatrixServiceBlockingStub stub1 =MatrixServiceGrpc.newBlockingStub(channel1);

MatrixServiceGrpc.MatrixServiceBlockingStub stub2 = MatrixServiceGrpc.newBlockingStub(channel2);

MatrixServiceGrpc.MatrixServiceBlockingStub stub3 = MatrixServiceGrpc.newBlockingStub(channel3);

You then need to do the footprinting e.g. find out how long one function call will take. You can use System.nanoTime() or System.currentTimeMillis() for this e.g.

long startTime = System.nanoTime();

//gRPC function call

long endTime = System.nanoTime();

long footprint= endTime-startTime;

Please be aware that gRPC supports asynchronous calls so make sure that the server has responded before you mark the endTime. In lab one we use a blocking stub so this is not an issue but to scale effectively you will need a non blocking stub so be careful when you are using different types. More information can be found at https://grpc.io/docs/languages/java/basics/.

After we have the footprint we need to calculate the number of multiply block calls we need and divide to get the number of servers required to meet the deadline which is supplied by the user. It will be something like the following:

int numberServer=(footprint*numBlockCalls)/deadline

You will then need to split the blocks among the different stubs. You could do this with if/else/switch statements or use something like ArrayList https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html to keep a queue of blocks which need to processed for each server.






热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图