-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic_types.py
51 lines (39 loc) · 1.04 KB
/
basic_types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
===========================
Basic type aliases.
===========================
Dr. Cai Wingfield
---------------------------
Embodied Cognition Lab
Department of Psychology
University of Lancaster
caiwingfield.net
---------------------------
2019
---------------------------
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum, auto
ActivationValue = float
Node = int
ItemIdx = Node
ItemLabel = str
Length = int
Size = int
class Component(Enum):
linguistic = 1
sensorimotor = 2
# Doesn't actually matter what the order is, it just needs to be defined and consistent to make sorting lists of
# items a stable process.
# This does mean that changing the definition of this order has the potential to change the model output.
def __lt__(self, other: Component):
return self.value < other.value
@dataclass(eq=True, frozen=True)
class Item:
idx: ItemIdx
component: Component
@dataclass(eq=True, frozen=True)
class SizedItem(Item):
size: Size