LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-29-2004, 12:51 PM   #1
vsurlan
Member
 
Registered: Jun 2004
Location: Zagreb, Croatia
Distribution: Debian Lenny
Posts: 49

Rep: Reputation: 15
Is there a C++ library for this?


Greets. I would like to code in C++ something like:

Rule rl("5.6.1978+7d");
while (1)
if (rl.ocurred()) go_to_grocery_store();

And:

Rule birthday_rule("11.6.*.5:20");
while (1)
if (birthday_rule.ocurred()) congratulate_birthday_at_5:20();

What is the name of the library that implements this?
Thanks in advance.
 
Old 06-29-2004, 03:37 PM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Couldn't you define a string containing the birthday date, or part of the birthday date and then use the std::string::startwith(), endswith() and contains() methods (or similar, these particular names might be the Java names, but equivalents exist in C++) to compar the date with the current date and time in particular format? The idea of rules is more suited to a language like prolog or lisp.
 
Old 07-01-2004, 04:53 AM   #3
vsurlan
Member
 
Registered: Jun 2004
Location: Zagreb, Croatia
Distribution: Debian Lenny
Posts: 49

Original Poster
Rep: Reputation: 15
Too complex

I think this is too complex functionality to be implemented in such a manner. And if I need any extensions I will endup in lots of trouble if I don't leave any room for new functionality. I was kind of hoping someone already did this (and probably has). But noone seems to be aware of such a library.
 
Old 07-01-2004, 07:39 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Sounds like you want to build a rule based engine.

Look at this link, maybe it would help.
http://www.tldp.org/HOWTO/AI-Alife-HOWTO-2.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which library ? wood@addanc Programming 3 02-20-2005 02:14 PM
adding a bulit in library to my library lg3 Linux - Software 1 10-17-2004 08:19 AM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
what is the function library of the basic graphics library in rethat9.0? zerwolve Red Hat 0 04-29-2004 09:18 PM
library.. johnyy Linux - Software 2 06-23-2003 10:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration