Documentation/Modules/ClassesModules: Unterschied zwischen den Versionen
Aus OpenDino
Dirk (Diskussion | Beiträge) (Created page with "== Need for Classes == <code>Modules</code> are connected. The information passed between these <code>Modules</code> may be a class of type * <code>Solution</code>s in the cas...") |
Dirk (Diskussion | Beiträge) (→Need for Classes) |
||
Zeile 3: | Zeile 3: | ||
<code>Modules</code> are connected. The information passed between these <code>Modules</code> may be a class of type | <code>Modules</code> are connected. The information passed between these <code>Modules</code> may be a class of type | ||
− | + | * <code>Solution</code>s in the case of an optimization or | |
− | + | * <code>Data</code> in the case of learning | |
Often, <code>Modules</code> look similar, and someone writing a new <code>Module</code> doesn't want to implement all interface methods by hand. | Often, <code>Modules</code> look similar, and someone writing a new <code>Module</code> doesn't want to implement all interface methods by hand. | ||
Zeile 11: | Zeile 11: | ||
− | + | * <code>Optimizer</code>s in the case of an optimization algorithm | |
− | + | * <code>Problem</code>s in the case of an optimization problem | |
− | + | * <code>Learner</code>s in the case of a learning algorithm | |
These classes already implement most of the necessary methods. A writer of an '''optimizer''' just has to implement the algorithm itself and no other details such as checking or connecting. | These classes already implement most of the necessary methods. A writer of an '''optimizer''' just has to implement the algorithm itself and no other details such as checking or connecting. |
Version vom 18. März 2013, 22:08 Uhr
Need for Classes
Modules
are connected. The information passed between these Modules
may be a class of type
-
Solution
s in the case of an optimization or -
Data
in the case of learning
Often, Modules
look similar, and someone writing a new Module
doesn't want to implement all interface methods by hand.
For these cases, we wrote the abstract classes
-
Optimizer
s in the case of an optimization algorithm -
Problem
s in the case of an optimization problem -
Learner
s in the case of a learning algorithm
These classes already implement most of the necessary methods. A writer of an optimizer just has to implement the algorithm itself and no other details such as checking or connecting.
Similarly, a writer of a problem just has to implement the evaluate(...)
method of the Problem
class.
In a learner, the method to override is run()
. It executes the learning algorithm.