Entity Generator usage for Assembly Line (Manufacturing)

3 Ansichten (letzte 30 Tage)
Abdul
Abdul am 29 Nov. 2024
Bearbeitet: Abhas am 29 Nov. 2024
My case is :
I have 05 different product type (M1,M2,M3,M4&M5). Each product has different yearly demand so different generation rate but all products are processed on the same manufacturing line consisting of 05 stations. Each product has different service time on each station. e.g M1 time on S1 is 15 sec but M2 time on S2 is 20 sec and so on.
How to generate this mix kind of entities through Entity generator or any other method. I am only able to generate one type.
Please help.

Antworten (1)

Abhas
Abhas am 29 Nov. 2024
Bearbeitet: Abhas am 29 Nov. 2024
Hi @Abdul,
To generate and simulate a mixed set of entities (M1, M2, M3, M4, M5) with different generation rates and service times on a manufacturing line, ensure the following:
  • Entity Generation: Each product type is generated based on its specific yearly demand and inter-arrival time.
  • Service Times: The service time of each product type at each station is defined.
  • Scheduling and Assignment: Products are dispatched to stations in accordance with their processing times and generation rates.
Here' a MATLAB example code to demonstrate the same:
% Define Parameters
products = {'M1', 'M2', 'M3', 'M4', 'M5'};
yearly_demand = [10000, 15000, 12000, 8000, 5000]; % Yearly demand for each product
service_times = [15, 20, 25, 30, 35; % S1 times for M1, M2, M3, M4, M5
20, 25, 15, 35, 30; % S2 times
30, 20, 25, 15, 35; % S3 times
35, 30, 20, 25, 15; % S4 times
25, 35, 30, 20, 15]; % S5 times (seconds)
% Simulation Parameters
total_sim_time = 3600 * 24 * 365; % Total time in seconds for a year
inter_arrival_times = total_sim_time ./ yearly_demand; % Calculate inter-arrival times
% Initialize Product Counters
product_counters = zeros(1, length(products));
% Generate Entities
entities = [];
current_time = 0;
while current_time < total_sim_time
% Determine next product and its inter-arrival time
[min_time, next_product] = min(inter_arrival_times);
product_counters(next_product) = product_counters(next_product) + 1;
% Add Entity
entities = [entities; struct('time', current_time, ...
'product', products{next_product}, ...
'service_times', service_times(:, next_product))];
% Update Time
current_time = current_time + min_time;
inter_arrival_times(next_product) = inter_arrival_times(next_product) + total_sim_time / yearly_demand(next_product);
end
% Process Entities in the Manufacturing Line
disp('Simulating Manufacturing Line...');
station_count = size(service_times, 1);
station_timers = zeros(1, station_count); % Initialize station timers
for i = 1:length(entities)
entity = entities(i);
disp(['Processing ', entity.product, ' at time ', num2str(entity.time), 's']);
for station = 1:station_count
station_timers(station) = max(station_timers(station), entity.time) + entity.service_times(station);
disp([' Station ', num2str(station), ' finishes at ', num2str(station_timers(station)), 's']);
end
end
Output:
You may refer to the below MathWorks documentation links to know more about the same:
  1. https://www.mathworks.com/help/simevents/entity-generation.html
  2. https://www.mathworks.com/matlabcentral/fileexchange/32692-multiple-simevents-entity-generation-per-time-step-simplified

Produkte


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by