@@ -26,10 +26,10 @@ function run_clust(data::ClustData;
2626
2727 # clustering
2828 clust_data, cost, centers_all, weights_all, clustids_all, cost_all, iter_all = run_clust_method (data;norm_op= norm_op, norm_scope= norm_scope, method= method, representation= representation, n_clust= n_clust, n_init= n_init, iterations= iterations, attribute_weights= attribute_weights, orig_k_ids= deepcopy (data. k_ids), kwargs... )
29-
29+
3030 # inter period segmentation (reduce the number of time steps per cluster - not fully implemented yet)
3131 if n_seg!= data. T && n_seg!= 0
32- clust_data_merged = ClustDataMerged (clust_data)
32+ clust_data_merged = ClustDataMerged (clust_data)
3333 segmented_merged= intraperiod_segmentation (clust_data_merged;n_seg= n_seg,norm_scope= norm_scope,iterations= iterations)
3434 clust_data = ClustData (segmented_merged)
3535 else # if interperiod segmentation is not used
@@ -38,7 +38,7 @@ function run_clust(data::ClustData;
3838
3939 # set configuration file
4040 clust_config = set_clust_config (;norm_op= norm_op, norm_scope= norm_scope, method= method, representation= representation, n_clust= n_clust, n_seg= n_seg, n_init= n_init, iterations= iterations, attribute_weights= attribute_weights)
41-
41+
4242 if get_all_clust_results
4343 # save all locally converged solutions and the best into a struct
4444 clust_result = ClustResultAll (clust_data,cost,clust_config,centers_all,weights_all,clustids_all,cost_all,iter_all)
@@ -85,7 +85,7 @@ function run_clust_method(data::ClustData;
8585 data_norm = attribute_weighting (data_norm,attribute_weights)
8686 end
8787 data_norm_merged = ClustDataMerged (data_norm)
88-
88+
8989 # initialize data arrays (all initial starting points)
9090 centers = Array {Array{Float64},1} (undef,n_init)
9191 clustids = Array {Array{Int,1},1} (undef,n_init)
@@ -112,10 +112,10 @@ function run_clust_method(data::ClustData;
112112 k_ids= orig_k_ids
113113 k_ids[findall (orig_k_ids.!= 0 )]= clustids[ind_mincost]
114114 # save in merged format as array
115-
115+
116116 # NOTE if you need clustered data more precise than 8 digits change the following line accordingly
117117 n_digits_data_round= 8 # Gurobi throws warning when rounding errors on order~1e-13 are passed in. Rounding errors occur in clustering of many zeros (e.g. solar).
118- clust_data_merged = ClustDataMerged (data. region,data. years,n_clust,data. T,round .(centers[ind_mincost]; digits= n_digits_data_round),data_type (data) ,weights[ind_mincost],k_ids)
118+ clust_data_merged = ClustDataMerged (data. region,data. years,n_clust,data. T,round .(centers[ind_mincost]; digits= n_digits_data_round),data_norm_merged . data_type,weights[ind_mincost],k_ids)
119119 clust_data = ClustData (clust_data_merged)
120120 return clust_data, cost_best, centers, weights, clustids, cost, iter
121121 end
0 commit comments