Calculation of wages
This model allows us to calculate
an employee's salary based on hourly earnings.
The model itself is shown in the picture below.
Next, we will add an auxiliary function of the model and specify the necessary parameters of the model.
In [ ]:
# Enabling the auxiliary model launch function.
function run_model( name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Checking the condition for loading a model into the kernel
model = engee.open( name_model ) # Open the model
model_output = engee.run( model, verbose=true ); # Launch the model
else
model = engee.load( Path, force=true ) # Upload a model
model_output = engee.run( model, verbose=true ); # Launch the model
engee.close( name_model, force=true ); # Close the model
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") # Launching the model.
Monthly_salary = collect(simout["Salary/PO per month"]);
println("Monthly salary: $(Monthly_salary.value[end])")
Conclusion
In this example, we have demonstrated the possibilities of using Engee for everyday tasks.