alloc: Add 'dynamic' allocation algorithm

The idea behind this meta algorithm is to automatically select one of
the other algorithms based on the system state. Basically algorithm B
will be selected if the PDCH usage is low to improve throughput and
latency. Algorithm A will be selected to support more concurrent MS.

This commit adds a first simple state-less version of this algorithm
that always tries B first and only if that fails A is tried
afterwards.

The following VTY command is added to the 'pcu' node:

 - alloc-algorithm dynamic

Ticket: #1934
Sponsored-by: On-Waves ehf
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index a29e5db..d664bbc 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -996,3 +996,26 @@
 
 	return 0;
 }
+
+/* Slot Allocation: Algorithm dynamic
+ *
+ * This meta algorithm automatically selects on of the other algorithms based
+ * on the current system state.
+ *
+ * The goal is to support as many MS and TBF as possible. On low usage, the
+ * goal is to provide the highest possible bandwidth per MS.
+ *
+ */
+int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts,
+	GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_,
+	uint32_t cust, uint8_t single, int use_trx)
+{
+	int rc;
+
+	rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx);
+	if (rc >= 0)
+		return rc;
+
+	rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx);
+	return rc;
+}