<jupyter_start><jupyter_text>1.Problem description, assumptions-------------------------------In RMS, we have a set of i operations and m set of machines for processing. Based on the processing route, jobs are divided into k sets. Each Job in a group has the same processing route. Machines are reconfigured To prepare machines for each group; therefore, we need k different configurations. Since each configuration's jobs have the same processing route, each configuration is a flow shop problem. It is required to set up the system for a new configuration. This setup's size depends on the two following configurations (going from configuration to which configurations). Reconfiguring from a configuration to an entirely different one is more extensive. Hence, the configuration sequence is also a single machine problem with sequence-dependent setup times. All in all, the RMS problem is a combined problem of (permutation flow shop and single machine problems).This research discusses the design of RCMSs. These systems are defined as multi RMCs, RMTs, material handling, and storehouse systems. Each RMT within an RMC has primary and configuration modules. A particular mixture of both different primary and configuration modules gives a unique operational capability to the RMT.The CRMS design problem involves the grouping of RMTs in each RMC by using information about the operation sequence for each part type and the assignment of each auxiliary module to the RMTs. In this research, an optimization model for the design of CRMS is proposed. The goal of the defined model is to best balance sustainability, social, environmental, and economical.The proposed optimization model adopts the following assumptions according to the standard literature within CRMS modeling:Operation-based process plan for the parts is known and fixed; Requirement of modules and machine-module compatibility information is known and unchangeable;Size limit for each RMC is to be given;Unique assignment of the machines to each cell;Auxiliary modules are available when needed;CNC machines are not considered in the optimization at this stage since they do not include elements of configurability.These assumptions are still realistic and representative of typical production environments. Furthermore, the model is flexible and can be adapted to match different beliefs (e.g., mono or multi-product model, mono or multi-period model).  Inserting Library<jupyter_code>import gurobipy as gp
from gurobipy import GRB
from random import randint<jupyter_output><empty_output><jupyter_text>2.Define Sets(Indices) $ i\,\,\,\,\,\,\,\,\,\,\,{\rm{Products}}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,i\,\,\, = \,\,1,\,...\,,P $<jupyter_code>num_Products = 3 # set of Products
products = [f"pro{i}" for i in range(num_Products)]<jupyter_output><empty_output><jupyter_text>$ o\,\,\,\,\,\,\,\,\,\,{\rm{Operations}}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,o\,\, = \,\,1,\,..\,.\,,O $<jupyter_code>num_operations = 5 # set of operations
operations = [f"opr{o}" for o in range(num_operations)]<jupyter_output><empty_output><jupyter_text>$ m\,\,\,\,\,\,\,\,\,\begin{array}{*{20}{l}}{{\rm{Machines}}}\end{array}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,m\, = \,1,...,M $<jupyter_code>num_machines = 5 # set of machines
machines = [f"mac{m}" for m in range(num_machines)]<jupyter_output><empty_output><jupyter_text>$ k\,\,\,\,\,\,\,\,\,\,{\rm{Configurations}}\,\,\,\,\,\,\,k\, = \,\,1,...,K{\rm{\;}}\, $<jupyter_code>num_configurations = 5 # set of configurations
configurations = [f"con{k}" for k in range(num_configurations)]<jupyter_output><empty_output><jupyter_text>$ j\,\,\,\,\,\,\,\,\,\,{\rm{Machine \, Cells}}\,\,\,\,\,\,\,j\, = \,\,1,...,J{\rm{\;}}\, $<jupyter_code>num_cells = 2 # set of cells
cells = [f"cell{c}" for c in range(num_cells)]<jupyter_output><empty_output><jupyter_text>$ t\,\,\,\,\,\,\,\,\,\,\,\begin{array}{*{20}{l}} {{\rm{Time \, Periods}}} \end{array}\,\,\,\,\,\,\,\,\,\,t\,\, = 1,...,T $<jupyter_code>num_times = 6 # set of cell
times = [f"time{c}" for c in range(num_times)]<jupyter_output><empty_output><jupyter_text>3.Define Parameters $ {P_j}\,\,\,\,\,\,\,\,\,\,\,\,\,\,{\rm{Maximum \, number \, of \, machines \, in \, each \, cell}}\,j $ | cell number  | cell1   | cell2   ||--------------|---------|---------|| capacity     |     3   |    3    |<jupyter_code>max_machines_in_cell = 3 #Pj
pj = {c : max_machines_in_cell for c in cells}<jupyter_output><empty_output><jupyter_text>${G_{omk}}\,\,\,\,\,\,\,\,\,\,{\rm{1 \, if \, operation \,}}\,o\,{\rm{can \, be \, performed \, on \, machine}}\,m\,{\rm{using \, configurations\, module\, type\,}}\,k\,{\rm{; }}0{\rm{\, otherwise\,}}\,\left( {\,Binary\,} \,\right)$<jupyter_code>gomk ={(o,m,k): 0 for o in operations for m in machines for k in configurations }
gomk_update = ({
   ('opr0','mac0','con0') : 1, 
   ('opr0','mac1','con3') : 1,
   ('opr0','mac2','con4') : 1,
   
   ('opr1','mac0','con1') : 1,
   ('opr1','mac1','con3') : 1,
   ('opr1','mac1','con1') : 1,
   
   ('opr2','mac2','con0') : 1,
   ('opr2','mac4','con2') : 1,
   ('opr2','mac3','con1') : 1,
   
   ('opr3','mac1','con4') : 1,
   ('opr3','mac3','con4') : 1,
   ('opr3','mac4','con0') : 1,
   
   ('opr4','mac0','con3') : 1,
   ('opr4','mac2','con2') : 1,
   ('opr4','mac3','con0') : 1,
   

   
    })
gomk.update(gomk_update)<jupyter_output><empty_output><jupyter_text>${t_{ijj'}}\,\,\,\,\,\,\,\,\,\,\,\,\,{\rm{Travel\, time\, for\, product}}\,i\,{\rm{\,from\, cell\,}}\,{\rm{j}}\,{\rm{\,to\, cell\,}}\,\,j'\,(\min )$<jupyter_code>tijj1 ={(i,j,j1): 0 for i in products for j in cells for j1 in cells }
tijj1_update = {
    ('pro0','cell0','cell1') : 0.5,
    ('pro0','cell0','cell2') : 0.75,
    ('pro0','cell1','cell2') : 1,
    
    ('pro1','cell0','cell1') : 1,
    ('pro1','cell0','cell2') : 1.5,
    ('pro1','cell1','cell2') : 2,
    
    ('pro2','cell0','cell1') : 1,
    ('pro2','cell0','cell2') : 1.25,
    ('pro2','cell1','cell2') : 1.5    
    
    }
tijj1.update(tijj1_update)<jupyter_output><empty_output><jupyter_text>${\lambda _{mk}}\,\,\,\,\,\,\,\,\,\,\,\,\begin{array}{*{20}{l}}{{\rm{Assembly\, time\, of\, }}\,{\rm{\,configurations\,}}\,k\,{\rm{\,on\, machine}}\,m\,}\end{array}(\min )$<jupyter_code>lamk ={(m,k): 0 for m in machines for k in configurations}
listlamk = {
        ('mac0','con0') : 4,
        ('mac0','con1') : 3,
        ('mac0','con3') : 5,
        
        ('mac1','con3') : 6,
        ('mac1','con4') : 2,

        
        ('mac2','con0') : 3,
        ('mac2','con4') : 4,
        ('mac2','con2') : 5,
        
        ('mac3','con4') : 2,
        ('mac3','con1') : 4,
        ('mac3','con0') : 6,
        
        ('mac4','con0') : 4,
        ('mac4','con2') : 3

        
        
        }

for i in listlamk:
    listlamk[i]= listlamk[i]*6
lamk.update(listlamk)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22591022079251352, 'fraction_numerical': 0.026319637373885072, 'mean_word_length': 3.6278755074424898, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '347113', 'license': 'MIT', 'n_tokens_mistral': 2325, 'n_tokens_neox': 2192, 'n_words': 624, 'path': 'first Gorubi.ipynb', 'repo_name': 'Ehsan-Rezaei97/Conference-paper-DCRMS', 'size': '6839'}