Professional Documents
Culture Documents
Group Project
Group Project
Group Project
2, 2021/2022
The purpose of this competition is to assess the students’ ability to apply adequate concurrent
programming skills and use appropriate constructs in the Java language to solve a real life
farming community problem.
Context:
The organic farm certifying body forms a group of inspectors to conduct inspections on the
organic farms on a timely basis, to enable the produce to meet all the requirements and criteria
for organic plant products. This allows the certifying body to identify and eliminate potential
frauds, for example some farms may mix organic and inorganic products together for
certification to increase the price of inorganic products.
Problem:
Traditionally, during the organic farm inspection, the inspectors will check the farm’s activity
logs, which consist of all farming activities carried out by the farmers on their plantation.
Activity logs come with different formats in different farms, some in hand-written format and
some in the Excel format. The inspectors then review the activity logs and consolidate the logs
into a standard format. Finally, they perform quantitative and qualitative analysis and prepare an
inspection report for certification.
The certifying body has engaged a team of software developers to help the farmers and
inspectors digitalize the activity logging and inspection process into a paperless solution. The
certifying body also concerns about the software system’s scalability to process the growing
amount of data concurrently when there are more farmers using the system in the future.
How do we simulate the huge amount of farming data entries and process the data concurrently
without compromising system reliability such as ensuring data loss and data inconsistency?
Forces:
CTK Page 1 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Solution:
System Scope:
Generate the data into text files with minimum number of records for each data as follows, and
load into your application:
1 Farms 10
2 Plants 100
3 Fertilizers 100
4 Pesticides 100
CTK Page 2 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Simulate farmers (users) activity logging in multiple threads. Farmers are part of the Users data
schema.
interface FarmerSimulatorInterface {
[]Farmer generateFarmers(int numberOfFarmers);
}
2. Implement the class Farmer that extends Thread or implements Runnable. In the run()
method, the Farmer object generates at least 1000 activities of random activity types for
a single random farm. For example, Farmer A generates 1234 activities of random types
for Farm A.
3. Write the farmers’ sent operations and success operations into log file(s). Make sure that
the correctness of your application is traceable and clearly shown as logs.
Apply your knowledge in concurrent programming to enable the system to handle data entry
from at least 100 farmers efficiently and effectively.
You are required to record and compare the duration spent to process the farmers’ data entry
before implementing concurrent programming logic and after implementing concurrent
programming logic. Justify the differences.
D. Disaster Simulation
Simulate disasters where farmer operations fail in the middle. Implement a workaround to
recover your failed threads. Justify how you attempt to resolve the disasters to allow farmers to
continue operations from the point where they failed. Ensure the atomicity of data.
CTK Page 3 of 14
WIF3003 Group Project Sem. 2, 2021/2022
E. Data Visualization
Identify which plant / fertilizer / pesticide is used in the activity. Check the unitType attribute
of the plant / fertilizer / pesticide. Process all activities into their respective standard units.
The standard units for mass, pack and volume unit types are as follows:
- mass -> kg
- pack -> pack (1000g)
- volume -> ℓ
After all activities have been successfully processed, allow the user to type in commands to
visualize the activities data in different ways:
Design and implement the i-Farm application in your own way with concurrent programming
concepts that you have learnt. Test with more farms and farmers and provide a performance test
result of how many farms and farmers can be handled by your improved application. Justify why
you think your way can be a better solution. Back your justifications with proper diagrams.
CTK Page 4 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Week 6:
Introduction: Describe the problem statement and justify how concurrent programming can
tackle the problem.
Methodology: Discuss at least 3 different methodologies that you have learnt to apply concurrent
programming concepts. Discuss why the methodology can / cannot solve the problem.
Roles and Responsibilities: Discuss the roles and responsibilities and work schedule for your
team.
Week 13:
System Implementation: Screenshot the source code for the key features implemented in your
application. Highlight your additional work (plus points).
Testimony: Describe testimony on responsibility, work done and lessons learnt. May attach with
Git commit logs as a proof of contributions.
Conclusion: Conclude how you have attempted to solve the concurrent programming problem
and your learning points in summary.
CTK Page 5 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Assessments:
Methodology 3 2.5 2 1 0
Methodology 3 2.5 2 1 0
Discussion 3 2.5 2 1 0
Week 13 (Presentation - 10%)
Teamwork 2 1.5 1.0 0.5 0
CTK Page 6 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Late submission
If for some good reason you are unable to submit your deliverables by the deadline, email me to
seek for a late submission. This should be done prior to the deadline. Late submission without
prior approval will have your marks deducted (5% per day overdue), or zero marks be assigned 3
days after the deadline.
Penalties
If you plagiarize someone else’ work, one or more of the following penalties may be imposed:
CTK Page 7 of 14
WIF3003 Group Project Sem. 2, 2021/2022
CTK Page 8 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Business Rules:
1. Each user must be associated with at least 1 farm and each farm can be associated with 0
or more users.
2. Each user can create multiple activities and each activity must be created by one and only
one user.
3. Each farm must be associated with at least 1 plant and each plant can be associated with 0
or more farms.
4. Each farm must be associated with at least 1 fertilizer and each fertilizer can be
associated with 0 or more farms.
5. Each farm must be associated with at least 1 pesticide and each pesticide can be
associated with 0 or more farms.
6. Each farm must be associated with at least 1 activity and each activity must be associated
with 1 farm.
CTK Page 9 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Farms
Users
Plants
Fertilizers
CTK Page 10 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Pesticides
2 Enspray 99 mass
3 Trilogy mass
Activities
_id date action type unit quantity field row farmId userId
1 2021-12-22 sowing fennel kg 3 1 1 2 2
Farms
CTK Page 11 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Users
CTK Page 12 of 14
WIF3003 Group Project Sem. 2, 2021/2022
Activities
CTK Page 13 of 14
WIF3003 Group Project Sem. 2, 2021/2022
field The field number in the farm where the activity took place.
row The row number in the field where the activity took place.
CTK Page 14 of 14