Best model for planning?
by mvermand
Hi,
I'd like some advice on how to make my model.
I need to plan maintenance-schedules for - let's say - airplanes.
Constraints are:
- planes are only at given moments available for maintenance (when not in
the air ;-)
- maintenance of a planes requires a number of techniciens (with specific
skills).
- techniciens have skills and also shifts and vacation.
Now, first I tought to make the maintenance of a plane the planningEntity.
But I did not know how to populate and match the techniciens.
So, second I tought to make a new Task-class the planningEntity.
A Task is a job that needs to be done by a technicien with specific skills.
Maintaining a plane requires then a number of tasks.
If I choose this model, I think I'll have to pass two Plannings variables to
the Task planningEntity:
1) a Maintenance-fact (Plane + Period + list of required tasks) and
2) a Technicien-fact (?)
Then I'll need to check if availabity of plane and availability of
technicien match and also skill-requirement of task and skills of
technicien.
Do you think this second model is the right one?
Will it perform well?
=> ? matching all combinations of plane availabilty and
techniciens-availability and -skills.
Thanks in advance
--
View this message in context: http://drools.46999.n3.nabble.com/Best-model-for-planning-tp4019464.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
(no subject)
by Post Office
����,��������euW��7���Q�<��0�������S��iV��V~S��K�q�/q�>t�|�����O0��jZ�u����<�����7'���Pf�p7^�`����A~ZGY�����,D��[� �gW���'C���#P��S7���
B�#l�%]�w��B�L����'�j0�>YU�������� �yw�T��~�L��6�F����;[�^o��y8�*/��(Jc�6�W���Ytm��������!4S*����A�E
���Vc��*��,<�~��2���f��A������V����0��:��%�&��d�
u��Cr������`m����4Rc���\�Y��e�mA�J�C%�'�1>������xN���&���JAM�X���P�V�D[F�{��-&C(�B�{�CD���3�E`�����8GJ�^pz(��4���v�
cZ�5.�F#C�W�Ia��[/�0�u?U��T�n��B44���Q
��:���/�-_�-(�?�*>��u��'�D6(�(��qw�`Q��y���Y�
������b��4 ��I�{��^��\?���[�u��5���:NW�h�22����bo��c� ��qy3R��d�2^�i��K�l��r������P�X�]?�rk��n8$L,�nGW`|��4�������Oj��J�yl���xgD���#W��nq�;�{2�Y��Z���t�Q���X�y�0����h$����k�i�;��"sw�,�r�Xn5�����KT��1��;U'5��S�hY���PT4W* %8G���f���H���'�
��R����M���l��uv C[��]2���J�.W�^�������n6�b��w�Y?�YqQs'q�U����X��4SC��wDO}��A�����}�V<�WOH�wK
MM���.��R�n��|�4��}C����|�HF�������} �r|J��;���
������c��^����M�SuE���$�ijz{;���OH?8 5��>�B�
��}M�:���F�#��Y�^�`;�&���b.��LM���(���jU
)E������H���g�u&v���u��a�Q���%7�ACV�^�H"��wpMg����/RgD���(�V�;�������}���u��)��aU���kt��P*��W��2��5e�7T�$��������d^���*��S����W^RR�Hu������n
��AX�a��u��h���.��G�;�m0)7�b���h6N$#q�U���yVb���J�U������Q�v�
�(~nMZ,�q����q�e���k����>T�Z:�`�3�]���
�fM������
--����V���j|N
���b{G6<�������Q��#�7���2�
r:���Fib\�Q�
|�"��D�����M`fS��7�A
12 years, 3 months
wkjltpkfnom m
by Post Office
The original message was received at Mon, 3 Sep 2012 16:00:20 +0530
from 138.182.126.120
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
12 years, 3 months
Drools rules not getting fired
by arunodhaya80
(Sorry about the repost. Was rejected earlier from the mailing list for lack
of subscription)
I am pretty new to Drools and am probably doing something really silly. The
problem is that for some reason my Drools rules are not getting fired.
If it helps, the rules fire when I shift back to a StatelessKnowledgeSession
and use the execute method to fire the rules. However, I need to use
AgendaFilter to filter rules and I understand that agenda filters aren't
supported on StatelessKnowledgeSession yet. As a first step, I just flipped
the session to a StatefulKnowledgeSession, inserted the facts and fired all
the rules.
Had to humbly say that I was breaking my head for the past couple of days on
this. Too bad, the documentation isn't that friendly for drools (I refer to
the official documentation and the user guide.
The Rule Validator code and the Spring factory bean with which I load the
Knowledge from the rule file is quoted below. I, personally, don't see any
issues with the FactoryBean. Any pointers would be of great help.
RuleValidator.java
StatefulKnowledgeSession ksession =
knowledgeBase.newStatefulKnowledgeSession();
ksession.setGlobal("validationReport", validationReport);
ksession.setGlobal("simpleCache", simpleCache);
ksession.setGlobal("ruleValidator", this);
ksession.insert(allClientDetails); //this is a list of ClientDetails objects
(facts)
ksession.fireAllRules();
ksession.dispose();
return validationReport;
KnowledgeBaseFactory.java
import java.io.IOException;
import java.util.Map;
import org.apache.log4j.Logger;
import org.drools.KnowledgeBase;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;
import org.springframework.beans.factory.FactoryBean;
public class KnowledgeBaseFactory implements FactoryBean<KnowledgeBase> {
private static Logger
logger=Logger.getLogger(KnowledgeBaseFactory.class);
private KnowledgeBase knowledgeBase;
public KnowledgeBaseFactory(Map<String,ResourceType> resourceMap) throws
IOException {
logger.debug("Resource Map : "+resourceMap);
final KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
for (Map.Entry<String, ResourceType>
eachRuleResource:resourceMap.entrySet()){
knowledgeBuilder.add(ResourceFactory.newClassPathResource(eachRuleResource.getKey()),eachRuleResource.getValue());
}
if (knowledgeBuilder.hasErrors()){
logger.error(knowledgeBuilder.getErrors().toString());
throw new
RuntimeException(knowledgeBuilder.getErrors().toString());
}
knowledgeBase = knowledgeBuilder.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
}
@Override
public KnowledgeBase getObject() throws Exception {
return knowledgeBase;
}
@Override
public Class<?> getObjectType() {
return knowledgeBase.getClass();
}
@Override
public boolean isSingleton() {
return true;
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-rules-not-getting-fired-tp401952...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
Insert global into working memory via Spring?
by dunnlow
I am using the drools 5.4 Integration Server (with Guvnor).
I have two instances of the Integration Server and (ideally) one instance of
the rules in Guvnor. I would like to create some rules that depend on the
instance of the Integration Server on which they are running. The vision is
that I would set a global variable somewhere that provided the server name
then use that variable in my rules.
I thought about adding a global variable via guvnor package configuration,
but I can only declare it (not set it). Also, if I could do that, I would
need another knowledge base, which I am trying to avoid.
I am considering setting up a declared object (so that the rule just fires
once) and a rule that if the object doesnt exist, creates it and calls a
function that checks a System Property and sets the value (I know, I've read
not to set globals in rules). If this rule has a high salience, this seems
like it could work - but is REALLY ugly.
Is there a better way?
Basically, I think I want to inject that value into the knowledge session
via Spring.
Thanks for any thoughts,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Insert-global-into-working-memory-via-S...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months