MA324-AMPL和R代写
时间:2023-05-08
THE AMAZOFF COMPANY
OPERATIONAL PLAN FOR THE AMAZOFF COMPANY
MA324 Mathematical Modelling and Simulation
Final Project 2022-23
Background
The Amazoff Company is a relatively new e-commerce company that is trying to relocate such that
their services will now be based in the UK. The Amazoff Company offers a wide array of services to
customers but their principal focus is logistics.
They heard about the LSE MA324 course and they reach out to you looking for advice in order to
set up part of the logistics plan of the company. The purpose of this project is to find a plan for the
warehousing, routing and e-commerce for a period of one year.
1 Warehousing
The company is unsure about where to open the warehouses around the UK. They have information
about the potential clients and their demand, but the cost of opening a facility depends heavily on
the city and other factors. Your first task is to help the Amazoff Company to take a decision on where
to open facilities and how to assign them to the clients. Each client is assigned to exactly one facility.
However, facilities (if open) can serve multiple clients. For that, generate randomly1 (uniformly) 15
points in the two dimensional square [−10,10]× [−10,10] representing the potential locations F to
open a new facility and generate (uniformly) other 60 points in the same region representing the
clients C .
For each pair (c, f ) ∈C×F , the cost of assigning a client to a given facility is given by the ℓ1-distance
between the coordinates of c and f . Further, the opening cost of facility f ∈ F is given by 100 · 3− f
units, i.e. facility i ∈ {1,2, . . . ,15} has opening cost 100 · 3−i . Find a model and solve using AMPL to
decide on the optimal way of opening and assigning facilities to clients.
Capacitated Model. Suppose now that each facility f ∈ F has a capacity of 100 ·2 f and suppose that
each client has a demand that is uniformly distributed between 1 and 25 units. Modify the above
model and solve using AMPL to find the optimal way of opening and assigning facilities to clients
while at the same time respecting the facilities capacities and the clients demands.
Balanced Loads. The company would like to maintain under control the difference between the
facility facing the highest demand and the one facing the lowest demand (out of the ones that have
opened), where the demand faced by a facility is the total demand of the clients assigned to that
facility. Propose a variant of the capacitated model in order to handle this. State clearly the idea
behind your constraints, as well as the formulation and its correctness. You do not need to solve this
model using AMPL.
2 Vehicle Routing
Your second task is to design the routing plan for the Amazoff Company. Suppose that the company
has a depot at the point (10,10) from where the vehicles start the dispatching operations. Suppose the
company currently has access to one vehicle for the dispatching operation. The Amazoff Company in
consequence wishes to focus on those clients, known as composite clients, who pay an annual fee for
improved delivery times.
Suppose that exactly 25 of the 60 clients are composite clients. Generate2 for this purpose a random
subset of the clients that will be those composite clients. The Amazoff Company wishes to focus only
on the 25 composite clients in what follows.
1Note that you should generate an initial set of locations and keep them for the rest of the task, i.e. it is not necessary to
generate a new set every time you solve it. For example, you can generate the client and facility locations using R.
2Note that you can similarly generate this subset of composite clients once and keep them for the rest of the task.
2
Design a model and solve using AMPL to decide how to perform the routing operation for the single
vehicle which starts and finishes at the depot while visiting all composite clients. Recall that the
vehicle should deliver at every composite client as many units as they demand. Note that all the
demand is going to be satisfied from products at the depot (ignoring facilities) and we assume that
the capacity of the vehicle is large enough to fit all demand from composite clients. Suppose that the
cost of going from client c to c ′ is given by the ℓ2-distance between them. The cost from the depot to
the clients is similarly calculated.
Multiple Vehicles. The Amazoff Company are thinking about increasing the number of vehicles
in order to decrease routing costs. Suppose for this purpose that the company has access to three
different vehicles in order to perform the dispatching operation. Design a new model and solve using
AMPL to decide the routing plan for the three vehicles. Compare the total cost obtained via this
approach with the one faced by having a single vehicle. Note that the three vehicles should once
more start and finish at the depot.
3 Internal Depot Transportation with Uncertainty
The Amazoff Company has an analytics group that is looking for certain advice on the following
situation. Recall that the Amazoff Company has a depot from where the vehicles start the dispatching
operations. The Amazoff Company employs workers and also has access to a number of electric
vehicles for transporting goods around the depot in order to ensure that the depot runs efficiently. In
particular, the Amazoff Company uses these vehicles to transport sold goods from different sources
to destinations within the depot.
Before commencing on its journey, each vehicle must unsurprisingly be loaded with items (possibly
several of the same type). Since these items are already sold, the Amazoff Company knows the profit
associated with each item type with certainty. Suppose the company wishes to maximise the profit of
the items transported by each vehicle while ensuring other requirements are met.
The dimensions of the vehicle are known and, as such, the Amazoff Company knows both the max-
imum capacity (i.e. volume) and the total weight that each vehicle can carry. Further, suppose that
due to insurance concerns, each vehicle can carry at most some given finite number of certain items.
Despite this, because the Amazoff Company makes use of an automated packaging process, the
volume and total weight of the individual items is not known with certainty. They do however have
some data about these uncertain parameters (such as their mean and variance). The Amazoff Comp-
any heard that you are familiar with certain techniques on optimisation under uncertainty. Can you
provide some advice on how to handle this situation?
Design a (general) model in order to decide how we should pack some electric vehicle accounting
for the uncertainty if we were given explicit data. In particular, you are tasked with introducing app-
ropriate decision variables, constraints and some objective function that would take account of the
problem’s uncertainty.
You are free if necessary to make additional assumptions here. However, in such case you should
give a brief explanation of how they play a role and help to improve your model. You do not need to
solve this model using AMPL.
4 Product Specific Insurance
In addition to logistics, the Amazoff Company offers some additional services. Amazoff Insurance is
one such service that has gained interest recently. Amazoff Insurance is currently a relatively small
insurance company that offers insurance for some higher ticket technology products including iPho-
nes, iPads, MacBooks, Laptops and TVs.
3
Due to the small size of the insurance company, the company makes use of a very simple insurance
model. They charge all customers the same fixed amount M per month independent of the age or
type of technology product.
The insurance company currently has n0 customers. Upon looking at past data, their analysts
have deduced that customers join Amazoff Insurance according to a Poisson process with rate λ per
month. The analysts have also deduced that each customer leaves Amazoff Insurance according to
a nonhomogeneous Poisson process with rate µ(t ) per month, where t is the time that elapsed from
the current time.
Each Amazoff Insurance customer has an accident (e.g. technical issue or damage) according to a
Poisson process with yearly rate α. For those customers that have an accident, there is a probability
0.6 that they will claim and the claim amount is 300X +500, where X is a discrete uniform random
variable over the set {0,1, . . . ,10}. Note that after a customer has an accident, they continue having
accidents according to the Poisson process until they leave Amazoff Insurance.
Amazoff Insurance has initial capital c0 available and they are worried that capital will drop below
some threshold C . It should be noted that if the capital did drop below C , then the company could
be in danger of legal action due to government legislation. The Amazoff Company in consequence
wishes to estimate P , namely the probability that at the end of 12 months the insurance company’s
capital will drop below C .
Build a discrete event simulation model to help Amazoff Insurance estimate P . Upon building your
simulation model define your variables, events, event lists and output variables. Further, write down
the pseudocode for each event case as in the lecture notes. Use K = 1000 iterations and the following
data, namely n0 = 0, c0 = £50,000, M = 300, C = £30,000, λ= 3, µ(t )= 112+t and α= 3.5. Comment on
your results.
Confidence. Let C12 be the capital after 12 months. Find an estimate of E [C12] for which you are
90% confident that it is within £500 of its true value. In how many iterations did you get this value and
what is the standard deviation of the estimator? Give an interval centered around you estimate where
we are 95% confident that the true value of E [C12] is within this interval.
Variance Reduction. Suppose the CEO of Amazoff is happy with your estimate of E [C12], however,
despite this they are worried about the variance of the estimator. They are wondering if there is anot-
her estimator of smaller variance. Write a paragraph proposing a variance reduction estimator (no
more than one) and explain why it would reduce the variance. (Do not perform any simulations).
4
Deliverables and Report Contents
The Amazoff Company wants you to develop optimisation models and utilise simulation for their
problems. Use AMPL to implement and solve these models. It is expected that you will then analyse
and discuss your findings on the basis of the questions outlined in the previous sections. Use R to
perform any simulations. You must deliver a Project Report containing your analysis and suggestions
but also detailing the modeling that you have undertaken. The Project report should consist of the
following (explained below in more detail):
1. A brief Executive Summary, discussing your main findings. It should be completely free of
any mathematical terms and discussion of modeling technicalities. It should describe the main
characteristics of the solutions obtained and answer all the questions.
2. A concise Management Report discussing all of your findings. The Management Report should
be independent of the Executive Summary (i.e. self-contained). Ideally, the Management Report
will avoid the use of unnecessary modeling technicalities.
3. A number of Technical Appendices. The technical appendices will give a complete account of
the modeling development. In particular, an appendix detailing the development of the optim-
isation models, where all entities of your models are defined and their meaning is explained in
detail, together with the models clearly stated.
4. An electronic copy of all of the model files that you develop as well as any additional computer
files used (if any).
5
Guidelines
• The deadline for submitting the project is 9thMay 2023 at 1pm.
• Please read the submission information very carefully on Moodle. This information is both
outlined below and on Moodle.
• There are two submission points, one is an Moodle assignment activity and one is a Gradescope
activity.
• To the Moodle assignment activity you must submit the electronic copy of the report (in pdf
form), the collaboration declaration form and one .zip file containing the model files and any
other computer files you have used. Your report, declaration document and .zip file should
each be named using your candidate number.
• To the Gradescope assignment you should submit only your .zip file. This is for code running
and similarity checking.
• The report must be typed and submitted to Moodle in .pdf format.
• You are allowed to work in groups of size atmost three on the models and associated files.
• All components of the report must be written individually. This includes but is not limited to
the executive summary, the management report, any mathematics with associated explanati-
on, any discussion of the relationship between the mathematics and the software made use of,
any computer code and any description of the software features used. You may not seek advice
from anyone else other than your fellow MA324 students (provided you report this) and the
MA324 lecturer.
• You must provide candidate exam number of all other students who you worked together with
and a brief statement on the extent of collaboration and the individual contributions. (For
example, “we prepared the basic formulation together and both of us had about the same contri-
bution”, “we prepared the basic formulation together but most constraints were developed by
me”, “we worked mostly separately but they explained to me the constraint about the maximum
distance”).
• Your brief statement should be written by firstly downloading (from Moodle) the file entitled
declaration.docx, editing the contents, renaming the file your candidate number and uploa-
ding this with your submission. Note that you do not have to sign this document as by uploa-
ding you are stating that any collaboration has been declared. It should be emphasised that this
document must be uploaded upon submission (even if you did not collaborate). Note that any
common elements of work that are not declared will be considered as cases of plagiarism.
• The report without the Technical Appendices should not exceed 10 pages with 11pts and single
spacing. Concise, focused and transparent reports are preferred.
• For generating random variables, you are only allowed to use the function runif(n) for n ∈Z>0.
If you use any other function to generate random variables you will be penalised.
• Start every R script with the command set.seed(1).
• You may use R code from some of the R scripts that have been provided in lectures or exercises.
If you do that, you need to write this clearly in your report otherwise this will be considered
plagiarism.
• Each R script should have detailed comments and explanations so that someone who does not
understand R can figure out what the code does at each step.
6
• The technical part of the report should explain what each corresponding R script does so that
someone that has not seen the R code can read the report and understand what you have done.
This includes outlining the pseudocode where appropriate.
• Use a separate R script for each scenario. If in one scenario you are using the same R script from
a previous question but with some modifications, then make another copy of the R script and
name this in a way such that it relates to the new scenario.
• Any project submitted without all associated computer files will be given a mark of zero.
• Any project submitted without all appropriate forms automatically implies a fail.
• The use of AI tools to help with any part of this assessment is strictly prohibited.
• The MA324 lecturer is permitted to give you help with the implementation of your models but
not the formulation.
7
Marking Scheme
Modelling 30
Implementation 20
Analysis 30
Organisation / Presentation 20
Total 100
• Modelling: The basic ingredients of the model are appropriately and meaningfully defined. The
essential decision variables for the model are introduced with suitable types. Constraints are
formulated correctly. In a similar fashion, the basic ingredients involved in any simulation are
clearly defined and appropriate pseudocode is outlined where appropriate.
• Implementation: All scenarios and extensions are implemented in a sound manner. The data
is provided in an appropriate form and separated from the model. Further, demonstrating
sufficient capacity to developing “good” models, namely avoiding unnecessary variables and
constraints, compactness of data representation as well as the use of more advanced features
for defining model entities. The correctness of the code and the use of appropriate R functions
and the quality of the comments that makes it possible for someone who does not know R to
understand what your code does.
• Analysis: The report should sufficiently demonstrate the ability to recognise and report all key
results of the models and relate these to the real-world problem as well as demonstrating su-
fficient understanding of these results with a discussion of requisite insight. Discussing lim-
itations of the model, the possible sources of these and how they may impact on the problem
decision.
• Organisation / Presentation: A main report and technical appendices which are clear, concise,
well organised, well formatted and well presented with appropriate use of figures and tables,
well commented and easy to navigate files.
essay、essay代写