Skip to content

Commit

Permalink
modified: CHANGELOG.md
Browse files Browse the repository at this point in the history
	modified:   Project.toml
	modified:   src/main/main_systems.jl
  • Loading branch information
Pierre BLAUD committed Apr 16, 2023
1 parent fbac765 commit 7cc9349
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# AutomationLabsSystems Changelog

## v0.1.9

* Add proceed_system_evaluation and proceed_system_constraints_evaluation methods.

## v0.1.8

* Remove dependencies AutomationLabsIdentification, MLJ, MLJMultivariateStatsInterface.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AutomationLabsSystems"
uuid = "6d3dfdf0-e107-48c6-a6ff-eced1a5a9334"
authors = ["Pierre BLAUD <pierre.blaud@ikmail.com> and contributors"]
version = "0.1.8"
version = "0.1.9"

[deps]
ControlSystems = "a6e380b2-a6ca-5380-bf3e-84a91bcd477e"
Expand Down
98 changes: 95 additions & 3 deletions src/main/main_systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ function proceed_system_linearization(
return system
end


"""
proceed_system_model_evaluation
Function that return the types of the model inside the systems from AutomationLabsIdentification.
Expand All @@ -209,9 +208,8 @@ function proceed_system_model_evaluation(
#model_type = AutomationLabsIdentification.Icnn()
model_type = Icnn()


elseif sublayers_name[1] == :resnet_input
#model_type = AutomationLabsIdentification.ResNet()
#model_type = AutomationLabsIdentification.ResNet()
model_type = ResNet()

elseif sublayers_name[1] == :polynet_input
Expand Down Expand Up @@ -281,3 +279,97 @@ function proceed_system_discretization(

return MathematicalSystems.@system x⁺ = A_sys * x + B_sys * u x system.X u system.U
end

"""
proceed_system_evaluation
Function that return the MathematicalSystems type of a AutomationLabsSystem.
** Required fields **
* `system`: the mathematital system that as in it the julia linear or non-linear function `f`.
"""
function proceed_system_evaluation(
system::MathematicalSystems.BlackBoxControlDiscreteSystem,
)
return MathematicalSystems.BlackBoxControlDiscreteSystem
end

function proceed_system_evaluation(
system::MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem,
)
return MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem
end

function proceed_system_evaluation(
system::MathematicalSystems.BlackBoxControlContinuousSystem,
)
return MathematicalSystems.BlackBoxControlContinuousSystem
end

function proceed_system_evaluation(
system::MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem,
)
return MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem
end

function proceed_system_evaluation(system::MathematicalSystems.LinearControlDiscreteSystem)
return MathematicalSystems.LinearControlDiscreteSystem
end

function proceed_system_evaluation(
system::MathematicalSystems.ConstrainedLinearControlDiscreteSystem,
)
return MathematicalSystems.ConstrainedLinearControlDiscreteSystem
end

function proceed_system_evaluation(
system::MathematicalSystems.LinearControlContinuousSystem,
)
return MathematicalSystems.LinearControlContinuousSystem
end

function proceed_system_evaluation(
system::MathematicalSystems.ConstrainedLinearControlContinuousSystem,
)
return MathematicalSystems.ConstrainedLinearControlContinuousSystem
end

"""
proceed_system_constraints_evaluation
Function that return the constraints of a AutomationLabsSystem.
** Required fields **
* `system`: the mathematital system that as in it the julia linear or non-linear function `f`.
"""
function proceed_system_constraints_evaluation(
system::Union{
MathematicalSystems.BlackBoxControlDiscreteSystem,
MathematicalSystems.BlackBoxControlContinuousSystem,
MathematicalSystems.LinearControlDiscreteSystem,
MathematicalSystems.LinearControlContinuousSystem,
},
)

return nothing, nothing
end

function proceed_system_constraints_evaluation(
system::Union{
MathematicalSystems.ConstrainedBlackBoxControlDiscreteSystem,
MathematicalSystems.ConstrainedBlackBoxControlContinuousSystem,
MathematicalSystems.ConstrainedLinearControlDiscreteSystem,
MathematicalSystems.ConstrainedLinearControlContinuousSystem,
},
)

x_cons =
hcat(LazySets.vertices_list(system.X)[end], LazySets.vertices_list(system.X)[begin])
u_cons =
hcat(LazySets.vertices_list(system.U)[end], LazySets.vertices_list(system.U)[begin])

# Evaluate if there is no X constraints
if (length(x_cons) == 0 || all(==(x_cons[1]), x_cons)) == true
x_cons = nothing
end

return x_cons, u_cons
end

0 comments on commit 7cc9349

Please sign in to comment.