energy.py 685 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- coding: utf-8 -*-


class Energy(object):
    def __init__(self, position):
        self._cache = {}
        try:
            position = position.copy()
        except AttributeError:
            pass
        self.position = position

    def at(self, position):
        return self.__class__(position)

16
17
18
19
20
21
22
23
    @property
    def position(self):
        return self._position

    @position.setter
    def position(self, position):
        self._position = position

24
25
26
27
28
29
30
31
32
33
34
    @property
    def value(self):
        raise NotImplementedError

    @property
    def gradient(self):
        raise NotImplementedError

    @property
    def curvature(self):
        raise NotImplementedError