Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Commit

Permalink
Fixed bug in load_transition_matrix_machine.
Browse files Browse the repository at this point in the history
For dot files where a single arrow had multiple transitions, the
original implementation missed all but the first transition. For
example, see +RIP.dot.
  • Loading branch information
David Darmon authored and David Darmon committed Apr 22, 2018
1 parent 7c8362d commit 64e61df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions compute_mixed_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@

import matplotlib.pyplot as plt

machine_fname = 'transCSSR_results/+even-exact.dot'
# machine_fname = 'transCSSR_results/+even-exact.dot'
# machine_fname = 'transCSSR_results/+golden-mean.dot'
# machine_fname = 'transCSSR_results/+barnettX.dot'
# machine_fname = 'transCSSR_results/+RnC.dot'
# machine_fname = 'transCSSR_results/+RIP-exact.dot'
# machine_fname = 'transCSSR_results/+RIP.dot'
machine_fname = 'transCSSR_results/+RIP.dot'
# machine_fname = 'transCSSR_results/+complex-csm.dot'
# machine_fname = 'transCSSR_results/+renewal-process.dot'

axs = ['0', '1']

inf_alg = 'transCSSR'

HLs, hLs, hmu, ELs, E, Cmu, etas_matrix = compute_ict_measures(machine_fname, axs, inf_alg, L_max = 20, to_plot = True)
HLs, hLs, hmu, ELs, E, Cmu, etas_matrix = compute_ict_measures(machine_fname, axs, inf_alg, L_max = 50, to_plot = True)

print('Cmu = {}\nH[X_{{0}}] = {}\nhmu = {}\nE = {}'.format(Cmu, HLs[0], hmu, E))

Expand Down
4 changes: 2 additions & 2 deletions transCSSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -3257,9 +3257,9 @@ def load_transition_matrix_machine(fname, inf_alg):
states[from_state] = True
states[to_state] = True

transitions = [line.split('\"')[1].split('\"')[0]]
transitions = line.split('\"')[1].split('\l')

for transition in transitions:
for transition in transitions[:-1]:
if inf_alg == 'CSSR':
x = transition.split(':')[0]
elif inf_alg == 'transCSSR':
Expand Down
6 changes: 2 additions & 4 deletions transCSSR_bc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

from filter_data_methods import *

import ipdb

def chisquared_test(morph1, morph2, axs, ays, alpha = 0.001, test_type = 'chi2'):
"""
Compare two predictive distributions (morph1 and morph2) to determine
Expand Down Expand Up @@ -2170,9 +2168,9 @@ def load_transition_matrix_machine(fname, inf_alg):
states[from_state] = True
states[to_state] = True

transitions = [line.split('\"')[1].split('\"')[0]]
transitions = line.split('\"')[1].split('\l')

for transition in transitions:
for transition in transitions[:-1]:
if inf_alg == 'CSSR':
x = transition.split(':')[0]
elif inf_alg == 'transCSSR':
Expand Down

0 comments on commit 64e61df

Please sign in to comment.