<jupyter_start><jupyter_text>Sanity checking exerciseYou are working on the production planning for a factory over the next 4 months. As inputs, you are given the starting inventory as 100 units, the fixed production costs of running the plant ($US), the unit production costs ($US), the costs for storing inventory ($US), monthly production capacity, and the monthly demand.All of our input variables are stored in a Pandas DataFrame named d and it's printed for you in the console. Your goal is to determine if he production line should be on or off, the amount of production, and amount of inventory to meet the monthly demand at the lowest costs.You now suspect that the value of the objective function is too low. Therefore, complete the code that will write the model specifications to a file, named production_planning_lp.txt, and print them to the console.You notice in the model specification that it did not include the fixed costs in the objective function. Finish defining the objective function to ensure that it includes the fixed costs.<jupyter_code>import pandas as pd
from pulp import *
d=pd.read_csv('book1.csv')
d.set_index('period')
# Initialize, Define Decision Vars.
model = LpProblem("Production Planning", LpMinimize)
time = [1, 2, 3, 4]
s = LpVariable.dicts("stock", [0, 1, 2, 3, 4], lowBound=0, cat="Integer")
x = LpVariable.dicts("prod", time, lowBound=0, cat="Integer")
y = LpVariable.dicts("plant_on", time, lowBound=0, cat="Binary")
print(s)
print(x)
print(y)
# Define Objective to Include Fixed Costs
model += lpSum([d.loc[t,"unit_prod"] * x[t] + d.loc[t,"unit_inv"]*s[t] 
                + d.loc[t,'fixed'] * y[t]
                for t in time])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09080257762155829, 'fraction_numerical': 0.00995899238429994, 'mean_word_length': 4.829351535836177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '395767', 'license': 'MIT', 'n_tokens_mistral': 501, 'n_tokens_neox': 472, 'n_words': 228, 'path': 'PULP/tutorial/3.7 Sanity checking exercise.ipynb', 'repo_name': 'nazmus-shakib-mist-ipe02/Operations-Research-Analytics', 'size': '1707'}