#include <functional>
#include <optional>
#include <tuple>
#include "externals/blockingconcurrentqueue.h"
#include "externals/small_vector.hpp"
#include "symmetri/callback.h"
#include "symmetri/tasks.h"
#include "symmetri/types.h"
Go to the source code of this file.
|
|
using | symmetri::AugmentedToken = std::tuple<size_t, Token> |
| | AugmentedToken describes a token with a color in a particular place.
|
| |
|
using | symmetri::SmallLog = std::vector<SmallEvent> |
| | a list of events
|
| |
|
using | symmetri::SmallVector = gch::small_vector<size_t, 4> |
| | General purpose stack-allocated mini vector for indices.
|
| |
|
using | symmetri::SmallVectorInput = gch::small_vector<AugmentedToken, 4> |
| | General purpose stack-allocated mini vector for colored markings.
|
| |
|
using | symmetri::Reducer = std::function<void(Petri &)> |
| | A Reducer updates the Petri-object. Reducers are used to process the post-callback marking mutations.
|
| |
|
| size_t | symmetri::toIndex (const std::vector< std::string > &m, const std::string &s) |
| | a small helper function to get the index representation of a place or transition.
|
| |
| gch::small_vector< size_t, 32 > | symmetri::possibleTransitions (const std::vector< AugmentedToken > &tokens, const std::vector< SmallVectorInput > &input_n, const std::vector< SmallVector > &p_to_ts_n) |
| | calculates a list of possible transitions given the current token-distribution. It returns a list of transitions sorted by priority. The first element being the high priority.
|
| |
| bool | symmetri::canFire (const SmallVectorInput &pre, std::vector< AugmentedToken > &tokens) |
| | Takes a vector of input places (pre-conditions) and the current token distribution to determine whether the pre-conditions are met, e.g. the transition is active.
|
| |
| void | symmetri::deductMarking (std::vector< AugmentedToken > &tokens, const SmallVectorInput &inputs) |
| | deducts the set input from the current token distribution
|
| |
|
std::tuple< std::vector< std::string >, std::vector< std::string >, std::vector< Callback > > | symmetri::convert (const Net &_net) |
| |
|
std::tuple< std::vector< SmallVectorInput >, std::vector< SmallVectorInput > > | symmetri::populateIoLookups (const Net &_net, const std::vector< Place > &ordered_places) |
| |
|
std::vector< SmallVector > | symmetri::createReversePlaceToTransitionLookup (size_t place_count, size_t transition_count, const std::vector< SmallVectorInput > &input_transitions) |
| |
|
std::vector< int8_t > | symmetri::createPriorityLookup (const std::vector< Transition > transition, const PriorityTable &_priority) |
| |
◆ canFire()
Takes a vector of input places (pre-conditions) and the current token distribution to determine whether the pre-conditions are met, e.g. the transition is active.
- Parameters
-
| pre | vector of preconditions |
| tokens | the current token distribution |
- Returns
- true if the pre-conditions are met
-
false otherwise
◆ deductMarking()
deducts the set input from the current token distribution
- Parameters
-
| inputs | a vector representing the tokens to be removed |
◆ possibleTransitions()
| gch::small_vector< size_t, 32 > symmetri::possibleTransitions |
( |
const std::vector< AugmentedToken > & | tokens, |
|
|
const std::vector< SmallVectorInput > & | input_n, |
|
|
const std::vector< SmallVector > & | p_to_ts_n ) |
calculates a list of possible transitions given the current token-distribution. It returns a list of transitions sorted by priority. The first element being the high priority.
- Parameters
-
- Returns
- gch::small_vector<size_t, 32>
◆ toIndex()
| size_t symmetri::toIndex |
( |
const std::vector< std::string > & | m, |
|
|
const std::string & | s ) |
a small helper function to get the index representation of a place or transition.
- Parameters
-
- Returns
- size_t