当前位置: 首页>>代码示例>>C#>>正文


C# Table.set方法代码示例

本文整理汇总了C#中Table.set方法的典型用法代码示例。如果您正苦于以下问题:C# Table.set方法的具体用法?C# Table.set怎么用?C# Table.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TableDrivenAgentProgram

        // persistent: percepts, a sequence, initially empty
        // table, a table of actions, indexed by percept sequences, initially fully
        // specified
        /**
         * Constructs a TableDrivenAgentProgram with a table of actions, indexed by
         * percept sequences.
         *
         * @param perceptSequenceActions
         *            a table of actions, indexed by percept sequences
         */
        public TableDrivenAgentProgram(Dictionary<List<Percept>, Action> perceptSequenceActions)
        {
            List<List<Percept>> rowHeaders = new List<List<Percept>>(perceptSequenceActions.Keys);

            List<System.String> colHeaders = new List<System.String>();
            colHeaders.Add(ACTION);

            table = new Table<List<Percept>, System.String, Action>(rowHeaders, colHeaders);

            foreach (List<Percept> row in rowHeaders)
            {
                table.set(row, ACTION, perceptSequenceActions[row]);
            }
        }
开发者ID:youthinkk,项目名称:aima-csharp,代码行数:24,代码来源:TableDrivenAgentProgram.cs

示例2: TableBasicTest

 public void TableBasicTest()
 {
     Table table = new Table(TEST_DATA_1, true);
     // 测试读取数据
     Assert.AreEqual(3, table.Headers.Count);
     Assert.AreEqual("BEGIN", table.Headers[0]);
     Assert.AreEqual("END", table.Headers[1]);
     Assert.AreEqual("DELAY", table.Headers[2]);
     Dictionary<string,string> dict = table.getDictionary(0);
     Assert.AreEqual(".1", dict["BEGIN"]);
     // 测试更新数据
     table.Data[0][0] = ".100";
     table.set("END", 0, ".200");
     Dictionary<string, string> dict2 = table.getDictionary(0);
     Assert.AreEqual(".100", dict2["BEGIN"]);
     Assert.AreEqual(".200", dict2["END"]);
     string actural = table.serialize();
     Assert.AreNotEqual(TEST_DATA_1.Replace("\r", ""), actural);
 }
开发者ID:kmlxk,项目名称:CommonLangDotnet,代码行数:19,代码来源:TableTest.cs

示例3: createTargetValueLearnerTable

        private Table<String, Learner, Double> createTargetValueLearnerTable(
                List<String> targetValues, Example e) {
		// create a table with target-attribute values as rows and learners as
		// columns and cells containing the weighted votes of each Learner for a
		// target value
		// Learner1 Learner2 Laerner3 .......
		// Yes 0.83 0.5 0
		// No 0 0 0.6

		Table<String, Learner, Double> table = new Table<String, Learner, Double>(
				targetValues, learners);
		// initialize table
		foreach (Learner l in learners) {
			foreach (String s in targetValues) {
				table.set(s, l, 0.0);
			}
		}
		foreach (Learner learner in learners) {
			String predictedValue = learner.predict(e);
			foreach (String v in targetValues) {
				if (predictedValue.Equals(v)) {
					table.set(v, learner, table.get(v, learner)
							+ learnerWeights[learner] * 1);
				}
			}
		}
		return table;
	}
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:28,代码来源:AdaBoostLearner.cs


注:本文中的Table.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。