Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
687f187f
Commit
687f187f
authored
Sep 23, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FutureDemandCreator to pass correct data to KE
parent
5861301f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
dream/KnowledgeExtraction/PilotCases/InputData_DemandPlanning.py
...nowledgeExtraction/PilotCases/InputData_DemandPlanning.py
+10
-8
dream/simulation/FutureDemandCreator.py
dream/simulation/FutureDemandCreator.py
+3
-1
No files found.
dream/KnowledgeExtraction/PilotCases/InputData_DemandPlanning.py
View file @
687f187f
...
...
@@ -33,11 +33,15 @@ import xlrd
import
random
import
urllib
def
generateDemandPlanning
(
input_url
):
def
generateDemandPlanning
(
input_url
,
PPOSQuantity
=
1000
,
PlannedWeek
=
1
,
PPOSToBeDisaggregated
=
'PPOS1'
,
MinPackagingSize
=
10
,
planningHorizon
=
10
):
"""Generate random demand from spreadsheet at input_url.
"""
# id is given as an integer and minus one
# ToDo we have to standardize data
PPOSToBeDisaggregated
=
'PPOS'
+
str
(
PPOSToBeDisaggregated
+
1
)
# Read data from the exported Excel file from RapidMiner and call the Import_Excel object of the KE tool to import this data in the tool
demand_data
=
urllib
.
urlopen
(
input_url
).
read
()
...
...
@@ -46,10 +50,6 @@ def generateDemandPlanning(input_url):
worksheets
=
workbook
.
sheet_names
()
worksheet_RapidMiner
=
worksheets
[
0
]
PPOSToBeDisaggregated
=
'PPOS4'
PPOSQuantity
=
1000
PlannedWeek
=
2
A
=
Import_Excel
()
Turnovers
=
A
.
Input_data
(
worksheet_RapidMiner
,
workbook
)
#Dictionary with the data from the Excel file
...
...
@@ -81,8 +81,10 @@ def generateDemandPlanning(input_url):
return
[
x
-
1
for
x
in
constrained_sum_sample_pos
(
n
,
total
+
n
)]
DemandProfile
=
{}
#Create a dictionary
MinPackagingSize
=
10
week
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]
# list that defines the planning horizon, i.e. 10 weeks
week
=
[]
# list that defines the planning horizon, i.e. 10 weeks
for
i
in
range
(
int
(
planningHorizon
)):
week
.
append
(
i
+
1
)
for
i
in
week
:
Demand
=
int
(
abs
(
random
.
normalvariate
(
avg
,
stdev
)))
# Generate a random, non-negative, integer number from the Normal distribution
...
...
dream/simulation/FutureDemandCreator.py
View file @
687f187f
...
...
@@ -57,7 +57,9 @@ class FutureDemandCreator():
from
dream.KnowledgeExtraction.PilotCases.InputData_DemandPlanning
\
import
generateDemandPlanning
G
.
generatedDemandPlanning
=
generateDemandPlanning
(
G
.
demandFile
)
G
.
generatedDemandPlanning
=
generateDemandPlanning
(
G
.
demandFile
,
PPOSToBeDisaggregated
=
G
.
TargetPPOS
,
PPOSQuantity
=
G
.
TargetPPOSqty
,
PlannedWeek
=
G
.
TargetPPOSweek
,
planningHorizon
=
G
.
maxSimTime
,
MinPackagingSize
=
G
.
minPackingSize
)
wbin
=
xlrd
.
open_workbook
(
file_contents
=
G
.
generatedDemandPlanning
)
MAData
=
G
.
RouteDict
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment