From 6b9684f4e7efa3dfe29ead936475bd4448245323 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 5 Apr 2017 16:07:13 +0200 Subject: DFADriver: update_model: Sort keys for easier comparison of outputs --- lib/Kratos/DFADriver.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Kratos') diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm index 7804d2b..b894248 100644 --- a/lib/Kratos/DFADriver.pm +++ b/lib/Kratos/DFADriver.pm @@ -615,7 +615,8 @@ sub assess_validation { sub update_model { my ($self) = @_; - while ( my ( $name, $state ) = each %{ $self->{log}{aggregate}{state} } ) { + for my $name (sort keys %{ $self->{log}{aggregate}{state} }) { + my $state = $self->{log}{aggregate}{state}{$name}; $self->model->set_state_power( $name, $state->{power}{median} ); for my $fname ( keys %{ $state->{power}{function} } ) { $self->model->set_state_params( @@ -625,9 +626,8 @@ sub update_model { ); } } - while ( my ( $name, $transition ) - = each %{ $self->{log}{aggregate}{transition} } ) - { + for my $name (sort keys %{ $self->{log}{aggregate}{transition} }) { + my $transition = $self->{log}{aggregate}{transition}{$name}; $self->model->set_transition_data( $name, $transition->{duration}{median}, -- cgit v1.2.3