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/libgnunet_plugin_ats_ril.h
23 * @brief ATS reinforcement learning solver
24 * @author Fabian Oehlmann
25 * @author Matthias Wachs
29 #include "gnunet_ats_plugin.h"
30 #include "gnunet-service-ats_addresses.h"
33 * ATS reinforcement learning solver
39 * Changes the preferences for a peer in the problem
41 * @param solver the solver handle
42 * @param peer the peer to change the preference for
43 * @param kind the kind to change the preference
44 * @param pref_rel the normalized preference value for this kind over all clients
47 GAS_ril_address_change_preference (void *solver,
48 const struct GNUNET_PeerIdentity *peer,
49 enum GNUNET_ATS_PreferenceKind kind,
53 * Add a single address within a network to the solver
55 * @param solver the solver Handle
56 * @param address the address to add
57 * @param network network type of this address
60 GAS_ril_address_add (void *solver,
61 struct ATS_Address *address,
65 * Transport properties for this address have changed
67 * @param solver solver handle
68 * @param address the address
69 * @param type the ATSI type in HBO
70 * @param abs_value the absolute value of the property
71 * @param rel_value the normalized value
74 GAS_ril_address_property_changed (void *solver,
75 struct ATS_Address *address,
81 * Transport session for this address has changed
83 * NOTE: values in addresses are already updated
85 * @param solver solver handle
86 * @param address the address
87 * @param cur_session the current session
88 * @param new_session the new session
91 GAS_ril_address_session_changed (void *solver,
92 struct ATS_Address *address,
94 uint32_t new_session);
97 * Usage for this address has changed
99 * NOTE: values in addresses are already updated
101 * @param solver solver handle
102 * @param address the address
103 * @param in_use usage state
106 GAS_ril_address_inuse_changed (void *solver,
107 struct ATS_Address *address,
111 * Network scope for this address has changed
113 * NOTE: values in addresses are already updated
115 * @param solver solver handle
116 * @param address the address
117 * @param current_network the current network
118 * @param new_network the new network
121 GAS_ril_address_change_network (void *solver,
122 struct ATS_Address *address,
123 uint32_t current_network,
124 uint32_t new_network);
127 * Remove an address from the solver
129 * @param solver the solver handle
130 * @param address the address to remove
131 * @param session_only delete only session not whole address
134 GAS_ril_address_delete (void *solver,
135 struct ATS_Address *address,
139 * Get application feedback for a peer
141 * @param solver the solver handle
142 * @param application the application
143 * @param peer the peer to change the preference for
144 * @param scope the time interval for this feedback: [now - scope .. now]
145 * @param kind the kind to change the preference
146 * @param score the score
149 GAS_ril_address_preference_feedback (void *solver,
151 const struct GNUNET_PeerIdentity *peer,
152 const struct GNUNET_TIME_Relative scope,
153 enum GNUNET_ATS_PreferenceKind kind,
157 * Start a bulk operation
159 * @param solver the solver
162 GAS_ril_bulk_start (void *solver);
165 * Bulk operation done
168 GAS_ril_bulk_stop (void *solver);
171 * Stop notifying about address and bandwidth changes for this peer
173 * @param solver the solver handle
174 * @param peer the peer
177 GAS_ril_stop_get_preferred_address (void *solver,
178 const struct GNUNET_PeerIdentity *peer);
181 * Get the prefered address for a specific peer
183 * @param solver the solver handle
184 * @param peer the identity of the peer
186 const struct ATS_Address *
187 GAS_ril_get_preferred_address (void *solver,
188 const struct GNUNET_PeerIdentity *peer);
190 /* end of libgnunet_plugin_ats_ril.h */