Skip to content

Commit

Permalink
changed exponentials scoring to wi+W+1 exp
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamDS committed Sep 27, 2017
1 parent 9079018 commit c73d9ce
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/TGI/Mutpro/Main/Network.pm
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,10 @@ sub closenessCentrality {

sub exponential {
my ( $this , $weight , $geodesic ) = @_;
my $weightExp = exp( -1 * abs( $weight ) / $this->{'weight_scale'} );
my $geodesicExp = exp( -1 * abs( $geodesic ) / $this->{'length_scale'} );
my $sign = 1;
if ( $weight < 0 ) { $sign = -1; }
my $score = $sign * $weightExp * $geodesicExp;
my $weightExp = abs( $weight / $this->{'weight_scale'} );
my $geodesicExp = $geodesic / $this->{'length_scale'};
my $weightShifted = $weight + $MAXWEIGHT + 1;
my $score = $weightShifted * exp( $weightExp - $geodesicExp );
return $score;
}

Expand Down

0 comments on commit c73d9ce

Please sign in to comment.