预定/报价
C#代写 | COMPSCI 711 Assignment 1
阿叶2024-05-15 17:55:08

留学生作业代写do not hesitate to contact me!
WeChat:lovexc60


COMPSCI 711
Assignment 1
Design and develop a faithful emulation of the Echo algorithm, extended to determine
the size of the network.
Discarding comments, the actual contents are unsigned integer numbers, separated by
whitespaces. Lines in each paragraph do not need to be sorted in any order.
Node IDs are non-zero numbers, but not necessarily in a closed range. Here they are 1,
2, 4, 3; but could as well be 10, 20, 40, 30. The first listed node is the source (initiator).
The neighbours order indicates a preference order, significant for choosing the parent
among several forward tokens arriving at the same logical time (see FAQ at the end).
Note that each edge has two arc transit times, one for each direction. Arc transit times
are fixed, but this resulting asynchronicity is enough for the purpose of this assignment.
As mentioned, the configuration transit time are not normalised. After normalisation, 10
becomes 1, and 1 becomes 0.1 (this could be the ε used in the lecture sample).
Hopefully, this commented example is enough to infer the underlying grammar of our
configuration files.

The output must be written to stdout, in two paragraphs, separated by one single
empty line. In the first paragraph, each output line indicates a message sent or received
(delivered), containing the following items (in order):
o Time: logical time (time units from start)
o Code: 1=received, 2=sent
o From: sender node
o To: receiving node (destination)
o Token: 1=forward, 2=return (one token is enough, but using two distinct tokens
improves the readability)
o Payload: for forward tokens 0, for return tokens the subtree size
The second paragraph consist of one single line, containing (in order): the total logical
time unnormalised, the total logical time normalised (integer division), the total number
of messages, the network size.
For readability, each number should be formatted on three positions, with one extra
space at the start. Additionally, the set codes should be followed by four spaces, and the
received code should be preceded by four spaces.
The output should appear sorted – sufficient on the first four columns, in order.
This is the output expected for our lecture sample, assuming the preceding
configuration:
time code from to tok pay
0 2 1 2 1 0
0 2 1 3 1 0
0 2 1 4 1 0
1 1 1 2 1 0
1 2 2 3 1 0
2 1 2 3 1 0
2 2 3 1 1 0
2 2 3 4 1 0
3 1 3 1 1 0
3 1 3 4 1 0
3 2 4 1 1 0
4 1 4 1 1 0