CAFC++ actor 模型框架
CAF —— C++ actor 模型框架,借鉴了 erlang 和 akka 的actor思想。使用C++现代编程规模实现。特点是:轻量级、分布式、简单、可适应以及无锁。
下载和构建:
git clone https://github.com/actor-framework/actor-framework cd actor-framework ./configure make make install [as root, optional]
示例代码:
#include <string> #include <iostream> #include "caf/all.hpp" using namespace std; using namespace caf; behavior mirror(event_based_actor* self) { // return the (initial) actor behavior return { // a handler for messages containing a single string // that replies with a string [=](const string& what) -> string { // prints "Hello World!" via aout // (thread-safe cout wrapper) aout(self) << what << endl; // terminates this actor // ('become' otherwise loops forever) self->quit(); // reply "!dlroW olleH" return string(what.rbegin(), what.rend()); } }; } void hello_world(event_based_actor* self, const actor& buddy) { // send "Hello World!" to our buddy ... self->sync_send(buddy, "Hello World!").then( // ... wait for a response ... [=](const string& what) { // ... and print it aout(self) << what << endl; } ); } int main() { // create a new actor that calls 'mirror()' auto mirror_actor = spawn(mirror); // create another actor that calls 'hello_world(mirror_actor)'; spawn(hello_world, mirror_actor); // wait until all other actors we have spawned are done await_all_actors_done(); // run cleanup code before exiting main shutdown(); }
评论
MOFScript模型转换框架
MOFScript主要的目的是开发支持模型到文本转换的工具和框架。比如支持从模型生成代码或文档等。它提供一个元模型未知的框架,这个框架能够使用任何类型的元模型和它的实例来生成文本。它的特性包括从基于M
MOFScript模型转换框架
0
EvalsOpenAI 模型评估框架
Evals是一个评估OpenAI模型的框架和一个开源的基准测试注册表,你可以使用Evals来创建和运行评估:使用数据集来生成提示信息衡量OpenAI模型所提供的完成度的质量比较不同数据集和模型的性能E
EvalsOpenAI 模型评估框架
0