Академический Документы
Профессиональный Документы
Культура Документы
Results include:
What happens if the consumer wage remains constant and if it increases by a
small random value (<5%) every 100 cycles?
Does the number of factories owned by each producer reach a stable number?
consumers>=several hundred
10 producers
5 products
each producer has one factory at the start, which can only produce one product at a
time.
Up to me to decide what the price will be for each product.
Contents
No.
Page
1. Introduction...............................................................................................................1
1.1
Purpose...............................................................................................................
1.2
DocumentConventions........................................................................................1
1.3
Intended Audience and Reading Suggestions.................................................... 1
1.4
Project Scope .....................................................................................................
1.5
References..........................................................................................................
2. Overall
Description..........................................................................................................4
2.1 Product Perspective............................................................................................. 4
2.2 Product Features..................................................................................................4
2.3 User Classes and Characteristics ..................................................
2.4 Operating Environment ..................................................
2.5 Design and Implementation Constraints..................................................
2.6
User Documentation ..................................................
2.7
Assumptions and Dependencies ..................................................
3. System Features
3.1 Customer
3.1 System Feature 1 - WageIncrease..................................................
3.2 System Feature 2 - - cashRunOut ..................................................
3.3 System Feature 3 - - updateCus ..................................................
3.4 System Feature 4 - priceOfProduct..................................................
3.5 System Feature 5 - buildFactory..................................................
3.6 System Feature 6 placeOrder ..................................................
3.7 System Feature 7 updateAll ..................................................
3.8 System Feature 8 updateProd ..................................................
3.9 System Feature 9 update ..................................................
3.9 System Feature 10 putOrder ..................................................
3.9 System Feature 11 - - cycle1..................................................
3.9 System Feature 12 - genRanInt..................................................
3.9 System Feature 13 - genRanNum..................................................
3.9 System Feature 14 cashCus..................................................
3.9 System Feature 15 newcycle..................................................
1. Introduction
This section introduces software requirement specification. It explains to us the
purpose scope of the software we are developing and also explains definitions and
references.
1.1 Purpose
Thi requirements specification document for the - Economic Modeling of Supply Chain
Logistics project. The aim of this document is to cover all areas require by this SRS
including description, system features, interface requirements and other components.
1.2 Scope
The Economic Modeling of Supply Chain Logistics project describes the functions and
requirements specified for a model illustrating the multitude of economic relationships
between producers and consumers, through studying the interactions between them
over a series of different cycles.
Cycle 1 - Focuses on the wage of the consumer remaining the same.
Cycle 2 - Wage of consumer rises randomly 5% every 100 cycles.
1.3 Definitions
Listed below are all of the definitions, abbreviations and acronyms used in this
document
Term Definition
SRS - Software Requirement Specification
IDE - Integrated Development Environment
1.5 References
Stuart Barnes notes - Advance Software Engineering
2. Overall Description
This section provides a background for the product requirements making them easier
to understand
2. Product Perspective
This diagram shows what the model functions the model should be able to carry out
1.1:
Alongside the features described on this diagram, the model should also be able to
provide outcomes for different forecasting estimations of economic growth for clients in
terms of:
Calculating no of orders per product
Calculating no of orders completed per factory
Calculating no of factories per producer
Calculating no of completed orders per factory per producer
Calculating no of cash reserves per producer
Frequency of Use
Software Developer: The most frequent user of the program due to the amount
of hours spent developing the program.
IT Support: Responsible for the maintaining communication between clients
and the company. The frequency of use delivered here is midway between the
client and developer.
Technical Expertise
Education Level
Software Developer: Although there is no need for a certain level of education,
there is a need for a certain understanding of skills in programming to be able
to develop what is asked for. See Technical Expertise.
IT Support: The member of this team needs to be able to understand the
basics of reading data for statistical purposes in order to be able to resolve an
queries the client has with their results.
Privilege Level
Software Developer: There are no restrictions on the privilege level given to
the developer. This is because he is responsible for all actions carried out on
the system.
IT Support: Does not need full access as the developers do. Instead, they
Need access to the interface which acts as a buffer between client and
software developer.
Product Functions Used The client does not get to see that the developer
or IT Support sees. They view the product at an interface level, which is
made user friendly and easy for a non-technical person to understand.
The product functions they see are completely different and consist of: User
Interface: log in password protected, store data about project, message
facility, collect results.
Technical Expertise The client does not need to have any amount of
technical expertise in order to be able to use this program, however the client
needs to know how to use the Internet.
Education Level The client does not need to have a certain education. IT is
available to all users regardless of their level of education.
3. System Features
Customer Class
3.1 System Feature 1 WageIncrease
This function addresses the statements:
A consumer receives extra cash at the end of each cycle (salary)
What happens if the consumer wage remains constant and if it increases by a small
random
value (<5%) every 100 cycles.
3.1.1 Description
This function adds the customers wage every cycle. It also allows customers
wage to be updated every cycle by a random amount ranging from 0 to 5%
every 100 cycles
3.1.2 Stimulus/Response Sequence
Each time this function is called the customers wage increases by 150 units
(the constant amount).
The second condition involves altering the program to address the questions the client
wishes to model namely: What happens if the consumer wage remains constant and if it
increases by a small random value (<5%) every 100 cycles.
By setting up a counter inside of the function, we can add one each time to this until it
reaches 100 - the cycle amount desired before increasing by the random value. At this 100
mark, we can reset the counter to 0 and use the random generator to produce a new
random number between 0 and 5% each cycle, which can be used as the new wage value
for the customers.
3.1.3 Functional Requirements
No functional requirements needed by this function
10
Producer Class
3.4 System Feature - priceOfProduct
This function addresses the statement:
3.4.1 Description
3.4.2- Stimulus/Response Sequence
3.4.3 Functional Requirements
No functional requirements needed by this function
11
12
Product Class
3.9 System Feature - updateProd
This function addresses the statement:
3.9.1 Description
Updates the product cost by a small random value -5% every 10 cycles.
3.9.2- Stimulus/Response Sequence
Like in function , we set s counter which when looped 10 cycles, resets
itself and uses the generate random number function to alter the cost by +/10 of the product price.
3.9.3 Functional Requirements
No functional requirements needed by this function
Factory Class
3.10 System Feature - update
This function addresses the statement:
3.10 Description
Responsible for ensuring the products are completed and added so that they
are available to order.
3.10.2- Stimulus/Response Sequence
3.10.3 Functional Requirements
13
Cycle Class
3.11 System Feature - newCycle
This function updates functions for product, customer and factory,
3.11.1 Description
Updates functions for product, customer and factory,
3.11.2- Stimulus/Response Sequence
This function calls the update function for each of the classes product,
customer and producer inside each of the update function other functions
relative to the called function are called.
It has been designed this way to keep everything centralised,
3.11.3 Functional Requirements
No functional requirements needed by this function
14
15
16
When the User login in this is what they are presented with:
17
At the top of the page, is the name of the company: Modelling Constancy with a Welcome
message directly below with the customers name.
Brief: This shows the brief that has been submitted by the client.
Results: This section is for displaying the results gathered by the Company from the
instructions on the brief.
18
19
20
Assumptions
Assumptions
Constraints, Assumptions and Dependencies
cash of each customer and each producer.
Efficiency Value
How is the efficiency value increase and decrease triggered?
How much of an increase and decrease are we looking at?
Does it remain the same, throughout a cycle or does it resort to original values of %
per production?
Pricing Threshold
How do we decide (based on price) the guidelines for consumers purchasing
products- where is the threshold?
Orders Threshold
How do we decide what the threshold is for the number of orders placed per factory?
Product Cost
Should we take into consideration:
manufacturing costs and length of time to manufacture each product.
Factories Threshold
At what point do we start building more factories as we have to consider the amount
of money in the budget as we dont want to be left with no cash.
21
Diagrams
Producer
IDLE_CYCLES : enum = 10
UNUSED_CYCLES : enum = 5
std::string name_;
cash_ : double
margin_ : std::vector<double>
factories_ : std::vector<factory>
*cycle1_ : cycle1
maxNumberOfOrders_ : unsigned int
destoryFactory_ : unsigned int
orderThreshold_ : unsigned int
orders_ : std::list<order>
completeOrders_ : std::list<order>
waitingOrders_ : std::list<order>
idlefactory_ : unsigned int
factoryBuilt_ : unsigned int
maxFactoryPerCycle_ : unsigned int
producer(const std::string &name, double cash, cycle1
*cycle1)
updateAll()
buildFactory()
getNumFacOwn()
setName(const std::string &name)
printPd()
priceOfProduct(int product) const
placeOrder(int product)
outOfCash()
Order
cyclesLeft : double
product : int
order(int prd, double total)
Customer
cash_: double
salary_: double
isSalaryConstant_ : bool
countCycles_ : int
*cycle1_ : cycle1
name_:std::string
customer(cycle* cycle, double salary,bool isSalaryConstant)
cash()
updateCus()
wageIncrease()
cashRunOut()
Cycle
NUMBER_OF_CYC : enum = 10
producers_ : std::vector<producer>
customers_ : std::vector<customer>
products_ : std::vector<product>
cycle1()
run()
newcycle()
genRanNum(double fMin, double
fMax)
genRanInt(int iMin, int iMax)
list<double> &::cashCus()
std::list<double> cusCash_
Product
COST_CHANGE_CYCLES : enum = 10
name_ : std::string
cost_ : double
cycles1_ : double
lastChanged_ : unsigned int
product(const std::string name, double cost, double cycles1);
updateProd();
string name();
cost();
cycles();
print ();
22
Factory
currentOrder_ : order
ordersCompeted_ : unsigned int
currentRunningCost_ : double
idleCost_ : double
idle_ : double
capacityLeft_ : double
currentProduct_ : int
*producer_ : producer
efficiency_ : double
constructionCost_ : double
runningCost_ : double
idlefactoryCost_ : double
factory(producer *producer)
constructionCost()
runningCost()
idlefactoryCost()
update()
Diagrams
00
23
Diagrams
Product 2 :Product
COST_CHANGE_CYCLES : 10
lastChanged_ : 2
orders name_ : " Product 2"
cost_ : 5.00
cycles1_ : 2.00
from
factory 1:Factory
ordersCompeted_ : 0
currentRunningCost_ : 50
idleCost_ : 15.00
idle_ : 2
capacityLeft_ : 1 .00
currentOrder: 2, 3.00
*producer_ : "producer A"
efficiency_ : 1.00
constructionCost_ : 1500.0
runningCost_ : 50.0
idlefactoryCost_ : 15.0
24
Diagrams
Product4 :Product
COST_CHANGE_CYCLES : 10
lastChanged_ : 2
name_ : " Product 4"
cost_ : 7.00
cycles1_ : 4.00
factory 1:Factory
ordersCompeted_ : 4
currentRunningCost_ : 50
idleCost_ : 15.00
idle_ : 2
capacityLeft_ : 1 .00
currentOrder: 4, 4.00
*producer_ : "producer A"
efficiency_ : 1.00
constructionCost_ : 1500.0
runningCost_ : 50.0
idlefactoryCost_ : 15.0
25
Diagrams
26
SDDocument
<Project Title>
<Author>
27
CONTENTS
PAGE
LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
1 Introduction
1.1 System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.4 Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 System Design
2.1 Design Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Design Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 System Architecture
3.1 Architecture Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 CakePHP Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Use Case Realizations
6.0
6.0
7.0
Real-Time Design
User Interface Design
Help System Design
Note:
For the remaining sections of this document, it is conceivable (and perhaps even
desirable) that one or more of the section topics are discussed in a separate design
document within the project. For each section where such a document exists, a reference
to the appropriate design document is all that is necessary. All such external (or
28
29
1 System Overview
1.1 Purpose
The purpose of this document is to provide us with the design details of the Economic
Modelling of Supply Chain Logistics Project described in the Software Requirement
Specification Document.
The expected audience are: developers whom will update or alter this program,
economists or business heads who are interested in using this to forecast budgeting and
business expansion and anyone whom is interested in doing any type of research into
financial modelling within supply chain sector.
1.2 Scope
< State the dominant design methodology. Overview the architecture of the product
briefly. Describe the external systems with which this system must interface. >
1.3 Glossary
EMSCLP - Economic Modelling of Supply Chain Logistics Project
SRS - Software Requirement Specification Document
1.4. References
30
2.
Design Method
Interaction
Protocol
Server
Client
31
< A software system is a set of communicating entities that collaborate to perform a task.
The Architectural Design shows these entities, their relationships and the relationship to
the actors in the system. This top level is a diagram where each entity has a name, a
(proto-) type, an abstract specification and an interface design. The abstract specification
is a description of its purpose, its functionality, its attributes (including dependency on other
entities) and the constraints under which it must operate. It also describes resources, that
is, any elements used by the entity which are external to the design such as physical
devices (e.g., printers), software services (e.g., math libraries) and processing resources
(e.g., buffers). The interface design is the list of the services that it provides to clients.
32
34
Test Plan
Test Plan
I have designed tests for each of the main five classes: cycle1, factory, customer,
producer and product. Each of these tests will ensure the validity of each of the
functions.
I will list the type of tests I will carry out for each function.
If statement, condition is a value or an expression that is used to determine which code
block is executed
Explain in detail what needs to be tested and how you will implement the tests. Ensure you
have adequately considered lower level unit/integration testing, and explain your choice of
test values.
Cycle1
cashCus()
Check that each customer is being push_back and the total amount of
customers
push_back.
Total amount of customers
Calculation for mean.
Factory
update() the no of cycles left to be completed of the current order
For each product, there are a number of cycles need to be carried out in order for the
product to be completed.
Based on the if condition - (currentOrder_.cyclesLeft <= 0.0) , if the number of cycles
left to be completed of the currentOrders cycle turns out to be greater than 0.0 then:
The idleCost becomes equal to the currentRunningCost_
1 is added to the idle_ variable.
For the second if condition - (capacityLeft_ < currentOrder_.cyclesLeft), if the
capacity left to be completed is greater than the number of cycles left to complete the
currentOrders cycle.
35
Test Plan
capacityLeft is subtract from currentOrder_.cyclesLeft resulting in
currentOrder_.cyclesLeft having less to complete hence freeing up the
capacityLeft becomes equal to zero.
For the other half of the if statement - the else condition, if the capacity left to be
completed is not greater than the number of cycles left to complete the currentOrders
cycle.
1 is added to the number of ordersCompeted variable
currentOrder_.cyclesLeft becomes equal to zero.
currentOrder_.cyclesLeft is subtracted from capacityLeft resulting in
capacityLeft
putOrder()
(currentOrder_.cyclesLeft <= 0.0) {
currentOrder_ = order;
if (capacityLeft_ >= currentOrder_.cyclesLeft)
{
capacityLeft_ -= currentOrder_.cyclesLeft;
currentOrder_.cyclesLeft = 0.0;
}
Producer
buildFactory()
Check that if statement is working
outOfCash()
Check that if condition is working by seeing
If cash is less then 0, does the program exit and print out the statement : "has
run out of cash. The simulation has ended"
If cash is greater than 0, the program carries on.
placeOrder()
Check that if statement is working
updateAll ()
36
Test Plan
Product
updateProd()
Check that if statement is working properly.
Customer()
wageIncrease()
cashRunOut()
Check that if condition is working by testing:
If cash is less then or equal to 0, does the program print out the statement: "
This customer has run out of cash. Please wait until the next cycle to reorder ".
If cash is greater than 0, the program carries on without printing out a
statement.
updateCus()
Results
Cycle1 - cashCus()
Condition
Expected
output
37
Actual
Outpu
t
Reasonfordifference
Test Plan
Check that each customer is
being push_back.
Total amount of customers
Calculation for mean.
Total amount of customers
push_back.
Condition
Expected
output
38
Actual
Output
Reasonfor
difference
Test Plan
resulting in capacityLeft
Factoryupdate()
putOrder()
Condition
Expected
output
Actual
Outpu
t
Expected
output
Actual
Outpu
t
Reasonfordifference
Producer - buildFactory()
Condition
39
Reasonfordifference
Test Plan
Producer - outOfCash()
Condition
Expected
output
Actual
Outpu
t
Expected
output
Actual
Outpu
t
Reasonfordifference
placeOrder()
Condition
updateProd()
40
Reasonfordifference
Test Plan
Condition
Expected
output
Actual
Outpu
t
Expected
output
Actual
Outpu
t
Reasonfordifference
updateAll ()
Condition
Customer -wageIncrease()
41
Reasonfordifference
Test Plan
Condition
Expected
output
Actual
Outpu
t
Expected
output
Actual
Outpu
t
Reasonfordifference
updateCus()
Condition
cashRunOut()
42
Reasonfordifference
Test Plan
Condition
Expected
output
43
Actual
Outpu
t
Reasonfordifference