2 This file is part of GNUnet.
3 (C) 2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file ats/plugin_ats_ril.h
23 * @brief ATS reinforcement learning solver
24 * @author Fabian Oehlmann
25 * @author Matthias Wachs
30 #include "gnunet_ats_plugin.h"
31 #include "gnunet-service-ats_addresses.h"
34 * ATS reinforcement learning solver
40 * Changes the preferences for a peer in the problem
42 * @param solver the solver handle
43 * @param peer the peer to change the preference for
44 * @param kind the kind to change the preference
45 * @param pref_rel the normalized preference value for this kind over all clients
48 GAS_ril_address_change_preference (void *solver,
49 const struct GNUNET_PeerIdentity *peer,
50 enum GNUNET_ATS_PreferenceKind kind,
54 * Add a single address within a network to the solver
56 * @param solver the solver Handle
57 * @param address the address to add
58 * @param network network type of this address
61 GAS_ril_address_add (void *solver,
62 struct ATS_Address *address,
66 * Transport properties for this address have changed
68 * @param solver solver handle
69 * @param address the address
70 * @param type the ATSI type in HBO
71 * @param abs_value the absolute value of the property
72 * @param rel_value the normalized value
75 GAS_ril_address_property_changed (void *solver,
76 struct ATS_Address *address,
82 * Transport session for this address has changed
84 * NOTE: values in addresses are already updated
86 * @param solver solver handle
87 * @param address the address
88 * @param cur_session the current session
89 * @param new_session the new session
92 GAS_ril_address_session_changed (void *solver,
93 struct ATS_Address *address,
95 uint32_t new_session);
98 * Usage for this address has changed
100 * NOTE: values in addresses are already updated
102 * @param solver solver handle
103 * @param address the address
104 * @param in_use usage state
107 GAS_ril_address_inuse_changed (void *solver,
108 struct ATS_Address *address,
112 * Network scope for this address has changed
114 * NOTE: values in addresses are already updated
116 * @param solver solver handle
117 * @param address the address
118 * @param current_network the current network
119 * @param new_network the new network
122 GAS_ril_address_change_network (void *solver,
123 struct ATS_Address *address,
124 uint32_t current_network,
125 uint32_t new_network);
128 * Remove an address from the solver
130 * @param solver the solver handle
131 * @param address the address to remove
132 * @param session_only delete only session not whole address
135 GAS_ril_address_delete (void *solver,
136 struct ATS_Address *address,
140 * Get application feedback for a peer
142 * @param solver the solver handle
143 * @param application the application
144 * @param peer the peer to change the preference for
145 * @param scope the time interval for this feedback: [now - scope .. now]
146 * @param kind the kind to change the preference
147 * @param score the score
150 GAS_ril_address_preference_feedback (void *solver,
152 const struct GNUNET_PeerIdentity *peer,
153 const struct GNUNET_TIME_Relative scope,
154 enum GNUNET_ATS_PreferenceKind kind,
158 * Start a bulk operation
160 * @param solver the solver
163 GAS_ril_bulk_start (void *solver);
166 * Bulk operation done
169 GAS_ril_bulk_stop (void *solver);
172 * Stop notifying about address and bandwidth changes for this peer
174 * @param solver the solver handle
175 * @param peer the peer
178 GAS_ril_stop_get_preferred_address (void *solver,
179 const struct GNUNET_PeerIdentity *peer);
182 * Get the prefered address for a specific peer
184 * @param solver the solver handle
185 * @param peer the identity of the peer
187 const struct ATS_Address *
188 GAS_ril_get_preferred_address (void *solver,
189 const struct GNUNET_PeerIdentity *peer);
191 /* end of plugin_ats_ril.h */