Task Description:
L Market Research, transliteration design requirements report
L Design software flow, programming software
l Organize design materials and write software design documents
L Programming promotional materials, for product display
Software feature requirements:
L The span of the production medium-term plan can be 1 years, the planned time unit is day, week or Lent (10 days) optional. Consider factors such as production cost, capacity, inventory cost and cost of capital consumption.
L Sales forecast data, capacity data should be flexible input, production planning data not only use data table Form output, preferably also can be output histogram form.
L production cost, inventory cost and capital consumption cost can be set without modifying the program.
L can expand other functions (such as economic batch calculation or set-up, consider the preparation and adjustment cost of batch production).
Conditions:
L run on microcomputer, no need to use network.
L programming languages are not limited.
L to be able to install independently.
Problem Analysis:
The aim is to develop production and inventory plans for the company, which minimizes total cost costs (including the cost of dismissal and new hires and inventory costs).
Consider the following model.
A company produces a certain commodity, the company currently has employees X, production capacity is per person/week/day (10 days) y pieces. Now that there is a Z-piece in stock, consider that for the longest next m months (M Max 12), the goods will be sold all (i.e. 0 in stock).
According to the market survey, the demand for the product in the next m months of the market is shown in table 1:
Table 1 Market demand for goods in the coming months
Month |
1 |
2 |
3 |
4 |
5 |
6 |
.... |
Demand (Pieces) |
A1 |
A2 |
A3 |
A4 |
A5 |
A6 |
.... |
According to this forecast data, the next m-month production and inventory planning, the total cost (including the dismissal of employees and new hires, as well as inventory costs) to a minimum. The company identified the following goals for the next plan:
(1) normal production and overtime production
The normal production of each person per month p pieces, and overtime production per person does not exceed Q pieces, and each overtime production of an increase in cost w.
(2) Dismissal or employment of new employees
Each dismissal of an employee is required to pay $ H, and every new employee hired will be charged the $ G training fee.
(3) Stock
Excess products can be stored in warehouses with a monthly storage fee of $ v per item.
According to the conditions given above, a production inventory plan with a minimum total cost is established and requires no inventory at the end of M months.
The problem of how to develop production and inventory plans to minimize the total cost of the company is an integer programming issue. Therefore, we can solve the programming constraint based on the known data. The total cost includes the cost of dismissal and new hires, as well as the two aspects of the inventory cost, and in the dismissal of employees and new employees on the monthly turnover problem on the optimization hypothesis, set variables, and then find the constraints of variables, and finally gave the production and inventory planning model, and the results of the model is analyzed.
"The original site from http://blog.csdn.net/u012662688/article/details/51726262, reproduced please specify"
#include <cstdio> #include <iomanip> #include <cmath> #include <algorithm> #include < iostream> #include <cstring> #include <cstdlib> #include <map> #include <vector> #include <windows.h>using namespace std; #define M 15//Avoid array out of Bounds # # CLR (A, B) memset (a,b,sizeof a) using namespace Std;int month;//plan span month number int tot_req;//Total plan required how much product int left_req;//The remaining production plan also need how much product int require[m];//Plan The demand for each month int pay[m];// Total monthly company expenditure int tmp_req[m];//is used to store the current minimum cost per month of demand//int now_worker;//now has an employee number int worker_num[m];//number of employees per month int up[m];// Maximum number of employees per month int down[m];//The minimum number of employees per month int work_ability;//The number of products produced per day, week and period, 0 for days, 1 for weeks, and 2 for the days/weeks/lent of int per_kind;// wage;//per employee per month salary int wage_mon[m];//Monthly employee Payroll Total Cost int pro_num[m];//monthly general production total int over_fee;//Each employee overtime to produce 1 pieces of product cost int Over_num [m];//amount of overtime produced per month int over_mon[m];//Total cost of overtime per month int over_max;//number of products per employee up to overtime int hire;//the cost of employing 1 new employees int fire;// Cost of firing 1 employees int hfire[m];//Total cost of employment per month int store_fee;//monthly excess product storage price int store_mon[m];//Total cost of storage per month int tot_fee=0;//Total cost int store_num[m];//per month inventory quantity int ans=0x3f3f3f3f;//minimum cost int cal () {int i; tot_fee=0; for (i=0;i<month;i++) {pay[i]=wage_mon[i]+over_mon[i]+store_mon[i]+hfire[i]; tot_fee+=pay[i];//Total cost equals payroll per month + total overtime + Storage fee Total + termination training cost} return Tot_fee; int final_req[m];int final_worker_num[m];int final_wage_mon[m];int final_pro_num[m];int final_over_num[M];int Final_ Over_mon[m];int final_store_mon[m];int final_store_num[m];int final_hfire[m];int final_pay[M];void Rec () {int i=0; for (i=0;i<month;i++) {final_req[i]=tmp_req[i]; Final_worker_num[i]=worker_num[i]; Final_wage_mon[i]=wage_mon[i]; Final_pro_num[i]=pro_num[i]; Final_over_num[i]=over_num[i]; Final_over_mon[i]=over_mon[i]; Final_store_mon[i]=store_mon[i]; Final_store_num[i]=store_num[i]; Final_hfire[i]=hfire[i];final_pay[i]=pay[i]; }}void DFS (int now) {//printf ("here\n"); if (now==month) {int t_ans=cal (); if (T_ans<ans) {Ans=t_anS Rec (); } return; } int Cur_require=require[now]-store_num[now]; Tmp_req[now]=cur_require; printf ("%d\n", Cur_require); int cur_worker_num=worker_num[now];//Save the current month initial number of employees up[now]= (int) ceil (1.0*cur_require/work_ability) *2;//employee Cap Down[now ]= (int) ceil (1.0*cur_require/(Work_ability+over_max)); printf ("%d%d\n", Up[now],down[now]); for (worker_num[now]=down[now];worker_num[now]<=up[now];worker_num[now]++) {pro_num[now]=worker_num[now]*work _ability; if (Cur_require>pro_num[now]) {Over_num[now]=cur_require-pro_num[now]; Over_mon[now]=over_num[now]*over_fee; }else{over_num[now]=0; over_mon[now]=0; worker_num[now+1]=worker_num[now];//the number of employees starting next month is equal to the number of employees this month wage_mon[now]=worker_num[now]*wage;//the total payroll cost for the month if (worker_num[now]>cur_worker_num) hfire[now]= (worker_num[now]-cur_worker_num) *hire;//hires employees to calculate else hfire[now]= ( Cur_worker_num-worker_num[now] *fire;//dismissed employee calculation store_num[now+1]= (pro_num[now]+over_num[now]-cur_require);//This month's demand equals this month's demand-the remainder of last month's inventory store_m On[now]=store_num[now+1]*store_fee; if (store_num[now+1]<0) printf ("<0%d\n", store_num[now+1]); DFS (NOW+1); }}int Check (char *x) {int sig=isdigit (x[0]), if (!sig) {printf ("Warning!) Illegal input! Please enter a positive integer! \ n "); Sleep (10000); exit (0);} else if (atoi (x) <0) {printf ("Warning!) Illegal input! Please enter a positive integer! \ n "); Sleep (10000); exit (0);} return 1;} int main () {freopen ("D:\\in.txt", "R", stdin); scanf ("%d", &month); printf ("%d\n", ans); int I,j,k;char str[5][10000]; for (i=0;i<month;i++) {scanf ("%s", str[0]); check (str[0]); Require[i]=atoi (str[0]); Tot_req+=require[i]; }for (i=0;i<5;i++) {scanf ("%s", Str[i]); check (Str[i]);} Store_num[0]=atoi (Str[0]); Worker_num[0]=atoi (str[1]);p er_kind=atoi (str[2]); Wage=atoi (str[3)); work_ability=atoi (Str[4]); if (per_kind==0) work_ability*=22;//assumes double Hugh, 30 days per month else if (per_kind==1) work_ability*=4; else if (per_kind==2) work_ability*=3;for(i=0;i<5;i++) {scanf ("%s", Str[i]); check (Str[i]);} Over_fee=atoi (Str[0]); Over_max=atoi (str[1]); Hire=atoi (str[2]); Fire=atoi (str[3]); Store_fee=atoi (Str[4]); DFS (0);p rintf ("initial demand per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", require[i],i==month-1? ') \ n ': ' \ t '); }freopen ("D:\\out.txt", "w", stdout);p rintf ("total demand \ n"); printf ("%d\n", Tot_req);p rintf ("Total cost \ n"); printf ("%d\n", ans); int ttot=0;printf ("total expenditure per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_pay[i],i==month-1? ') \ n ': ' \ t '); } printf ("Actual demand per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_req[i],i==month-1? ') \ n ': ' \ t '); } printf ("Production per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_pro_num[i],i==month-1? ') \ n ': ' \ t '); Ttot+=final_pro_num[i]; } printf ("Overtime production per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_over_num[i],i==month-1? ') \ n ': ' \ t '); } printf ("Employee amount per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_worker_num[i],i==mOnth-1? ' \ n ': ' \ t '); } printf ("Dismissal training fee per month \ \"); for (i=0;i<month;i++) {printf ("%d%c", final_hfire[i],i==month-1? ') \ n ': ' \ t '); } printf ("Storage fee per month \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_store_mon[i],i==month-1? ') \ n ': ' \ t '); } printf ("Monthly employee salary \ n"); for (i=0;i<month;i++) {printf ("%d%c", final_wage_mon[i],i==month-1? ') \ n ': ' \ t '); } fclose (stdout); return 0;}
Develop a software for production plan preparation