pytams.tams

Module Contents

Classes

TAMS

A class implementing TAMS.

exception pytams.tams.TAMSError[source]

Bases: Exception

Exception class for TAMS.

class pytams.tams.TAMS(fmodel_t, parameters: dict)[source]

A class implementing TAMS.

Hold a Trajectory database and mechanisms to populate, explore and IO the database.

initTrajDB() None[source]

Initialize the trajectory database.

appendTrajsToDB() None[source]

Append started trajectories to the pool file.

saveSplittingData(a_db: str) None[source]

Write splitting data to XML file.

readSplittingData(a_db: str) None[source]

Read splitting data from XML file.

restoreTrajDB() None[source]

Initialize TAMS from a stored trajectory database.

loadTrajectoryDB(dbFile: str) int[source]

Load trajectories stored into the database.

Parameters:

dbFile – the database file

Returns:

number of trajectories loaded

check_database_consistency(a_db: str) None[source]

Check the restart database consistency.

verbosePrint(message: str) None[source]

Print only in verbose mode.

elapsed_time() float[source]

Return the elapsed wallclock time.

Since the initialization of TAMS [seconds].

Returns:

TAMS elapse time.

remaining_walltime() float[source]

Return the remaining wallclock time.

[seconds]

Returns:

TAMS remaining wall time.

out_of_time() bool[source]

Return true if insufficient walltime remains.

Returns:

boolean indicating wall time availability.

init_trajectory_pool()[source]

Initialize the trajectory pool.

task_delayed(traj: pytams.trajectory.Trajectory) pytams.trajectory.Trajectory[source]

A worker to generate each initial trajectory.

Parameters:

traj – a trajectory

generate_trajectory_pool() None[source]

Schedule the generation of a pool of stochastic trajectories.

worker(t_end: float, min_idx_list: List[int], rstId: str, min_val: float) pytams.trajectory.Trajectory[source]

A worker to restart trajectories.

Parameters:
  • t_end – a final time

  • min_idx_list – the list of trajectory restarted in the current splitting iteration

  • rstId – Id of the trajectory being worked on

  • min_val – the value of the score function to restart from

do_multilevel_splitting() None[source]

Schedule splitting of the initial pool of stochastic trajectories.

compute_probability() float[source]

Compute the probability using TAMS.

Returns:

the transition probability

nTraj() int[source]

Return the number of trajectory used for TAMS.