Skip to content

Commit

Permalink
fix formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Jan 3, 2025
1 parent 1140b9c commit db7a67e
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/algorithms/sequential_algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ function build_main_problem!(
container::MultiOptimizationContainer{SequentialAlgorithm},
template::MultiProblemTemplate,
sys::PSY.System,
)
end
) end

# The drawback of this approach is that it will loop over the results twice
# once to write into the main container and a second time when writing into the
Expand All @@ -46,20 +45,26 @@ function write_results_to_main_container(container::MultiOptimizationContainer)
if num_dims == 1
dst[1:length(axes(src)[1])] = data
elseif num_dims == 2
#ychen fix horizontal passing ACbusinjection issue
if field==:expressions
field1= :parameters
#ychen fix horizontal passing ACbusinjection issue
if field == :expressions
field1 = :parameters
subproblem_data_field1 = getproperty(subproblem, field1)
src1=subproblem_data_field1[InfrastructureSystems.Optimization.ParameterKey{PowerSimulationsDecomposition.StateEstimationInjections, PSY.ACBus}("")]
B=parse.(Int,axes(src1.parameter_array)[1])
A=axes(src)[1]
C=filter(x -> !(x in B), A)
columns= C
src1 =
subproblem_data_field1[InfrastructureSystems.Optimization.ParameterKey{
PowerSimulationsDecomposition.StateEstimationInjections,
PSY.ACBus,
}(
"",
)]
B = parse.(Int, axes(src1.parameter_array)[1])
A = axes(src)[1]
C = filter(x -> !(x in B), A)
columns = C
else
columns = axes(src)[1]
end
#ychen end
len = length(axes(src)[2])
columns = axes(src)[1]
end
#ychen end
len = length(axes(src)[2])
dst[columns, 1:len] = PSI.jump_value.(src[:, :])
#try
# println("======111 dst,k,",dst[203, :],",subproblem,",k)
Expand Down Expand Up @@ -118,7 +123,7 @@ function solve_impl!(
for (index, subproblem) in container.subproblems
@debug "Solving problem $index"
status = PSI.solve_impl!(subproblem, sys)
println("yc -- solving problem,",index)
println("yc -- solving problem,", index)
if status != ISSIM.RunStatus.SUCCESSFULLY_FINALIZED
return status
end
Expand Down

0 comments on commit db7a67e

Please sign in to comment.