Payroll calculation¶
This model allows us to calculate the salary This model allows us to calculate the salary of an employee on an hourly basis.
The model itself is shown in the figure below.
Next, let's add the auxiliary function of the model and specify the necessary parameters of the model.
In [ ]:
# Подключение вспомогательной функции запуска модели.
function run_model( name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
model = engee.open( name_model ) # Открыть модель
model_output = engee.run( model, verbose=true ); # Запустить модель
else
model = engee.load( Path, force=true ) # Загрузить модель
model_output = engee.run( model, verbose=true ); # Запустить модель
engee.close( name_model, force=true ); # Закрыть модель
end
sleep(5)
return model_output
end
Out[0]:
In [ ]:
Salary = 30000;
Hours_per_day = 8;
Working_days_per_month = 20;
Hours_worked_per_day = [8,5,6,7,10,12,8,6,8,8,8,12,12,5];
Let's run the model and output the calculated tax amount.
In [ ]:
run_model("Salary") # Запуск модели.
Monthly_salary = collect(simout["Salary/ЗП за месяц"]);
println("Заработная плата за месяц: $(Monthly_salary.value[end])")
Conclusion¶
In this example we have demonstrated the possibilities of using Engee to realise everyday tasks.