Re: [Planner Dev] Cost computation - some test cases



Hi guys!

I have tested all the samples and applying the change:

http://bugs.gnome.org/show_bug.cgi?id=136053#c11

all works nicely.

If you start playing with resource assignments units, for example
putting 33% of the resource assigned to a task, decimal number starts to
appear in the cost. We have to look at this case also with care because
you know, some cents of dollars could be a great amount in big projects
;-)

I attach the patch.

Cheers




El dom, 18-04-2004 a las 12:49, Lincoln Phipps escribió:
> Xavier Ordoquy wrote:
> > Here are some cost computation sample. I'll try to make them test cases
> > when the Python binding will be available.
> > 
> 
> Here's a sample plan thats matches your test cases - note I've created a 
> Resource 3 so it can have a cost of 25/h.
> 
> Lincoln.
> 
> 
> > =================================================================
> > Test case 1
> > 
> > Resource R1: cost is 12.5 (100 per day)
> > Tasks T1: work is one day, R1 assigned 100%
> > 
> > T1:
> > Duration should be one day
> > Cost should be 100
> > 
> > =================================================================
> > Test case 2
> > 
> > Resource R1: cost is 12.5 (100 per day)
> > Tasks T1: work is one day, R1 assigned 50%
> > 
> > T1:
> > Duration should be 2 days
> > Cost should be 100
> > 
> > =================================================================
> > Test case 3
> > 
> > Resource R1: cost is 12.5 (100 per day)
> > Tasks T1: work is two day, R1 assigned 200%
> > 
> > T1:
> > Duration should be 1 days
> > Cost should be 200
> > 
> > =================================================================
> > Test case 4
> > 
> > Resource R1: cost is 12.5 (100 per day)
> > Resource R2: cost is 12.5 (100 per day)
> > Tasks T1: work is two day, R1 and R2 assigned 100%
> > 
> > T1:
> > Duration should be 1 days
> > Cost should be 200
> > 
> > =================================================================
> > Test case 5
> > 
> > Resource R1: cost is 12.5 (100 per day)
> > Resource R2: cost is 12.5 (100 per day)
> > Tasks T1: work is 3 day, R1 assigned 100%, R2 assigned 50%
> > 
> > T1:
> > Duration should be 2 days
> > Cost should be 300
> > 
> > =================================================================
> > Test case 6
> > 
> > Resource R1: cost is 12.5 (100 per day)
> > Resource R2: cost is 25 (100 per day)
> > Tasks T1: work is 3 day, R1 assigned 100%, R2 assigned 50%
> > 
> > T1:
> > Duration should be 2 days
> > Cost should be 400
> > 
> > 
> > 
> > _______________________________________________
> > Planner-dev mailing list
> > Planner-dev lists imendio com
> > http://lists.imendio.com/mailman/listinfo/planner-dev
> > 
> 
> 
> ______________________________________________________________________
> <?xml version="1.0"?>
> <project name="Task Cost Test Cases" company="" manager="" phase="" project-start="20040418T000000Z" mrproject-version="2" calendar="1">
>   <properties>
>     <property name="cost" type="cost" owner="resource" label="Cost" description="standard cost for a resource"/>
>   </properties>
>   <phases/>
>   <calendars>
>     <day-types>
>       <day-type id="0" name="Working" description="A default working day"/>
>       <day-type id="1" name="Nonworking" description="A default non working day"/>
>       <day-type id="2" name="Use base" description="Use day from base calendar"/>
>     </day-types>
>     <calendar id="1" name="Default">
>       <default-week mon="0" tue="0" wed="0" thu="0" fri="0" sat="1" sun="1"/>
>       <overridden-day-types>
>         <overridden-day-type id="0">
>           <interval start="0800" end="1200"/>
>           <interval start="1300" end="1700"/>
>         </overridden-day-type>
>       </overridden-day-types>
>       <days/>
>     </calendar>
>   </calendars>
>   <tasks>
>     <task id="1" name="TEST1" note="" work="28800" start="20040418T000000Z" end="20040419T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work">
>       <task id="2" name="T1-TASK1" note="Duration should be 1.0 Day,&#10;Overall cost should be 100." work="28800" start="20040418T000000Z" end="20040419T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work"/>
>     </task>
>     <task id="3" name="TEST2" note="" work="57600" start="20040418T000000Z" end="20040420T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work">
>       <task id="4" name="T2-TASK1" note="Duration should be 2 Days,&#10;Overall cost should be 100." work="28800" start="20040418T000000Z" end="20040420T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work"/>
>     </task>
>     <task id="5" name="TEST3" note="" work="28800" start="20040418T000000Z" end="20040419T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work">
>       <task id="6" name="T3-TASK1" note="Duration Should be 1 Days,&#10;Overall cost should be 200." work="57600" start="20040418T000000Z" end="20040419T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work"/>
>     </task>
>     <task id="7" name="TEST4" note="" work="28800" start="20040418T000000Z" end="20040419T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work">
>       <task id="8" name="T4-TASK1" note="Duration Should be 1 day,&#10;Overall cost should be 200." work="57600" start="20040418T000000Z" end="20040419T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work"/>
>     </task>
>     <task id="9" name="TEST5" note="" work="57600" start="20040418T000000Z" end="20040420T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work">
>       <task id="10" name="T5-TASK1" note="Duration should be 2 days,&#10;Overal cost should be 300." work="86400" start="20040418T000000Z" end="20040420T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work"/>
>     </task>
>     <task id="11" name="TEST6" note="" work="57600" start="20040418T000000Z" end="20040420T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work">
>       <task id="12" name="T6-TASK1" note="Duration should be 2 Days,&#10;Overall cost should be 400." work="86400" start="20040418T000000Z" end="20040420T170000Z" percent-complete="0" priority="0" type="normal" scheduling="fixed-work"/>
>     </task>
>   </tasks>
>   <resource-groups/>
>   <resources>
>     <resource id="1" name="R3-25" short-name="" type="1" units="0" email="" note="" std-rate="25">
>       <properties>
>         <property name="cost" value=""/>
>       </properties>
>     </resource>
>     <resource id="2" name="R2-12.5" short-name="" type="1" units="0" email="" note="" std-rate="12.5">
>       <properties>
>         <property name="cost" value=""/>
>       </properties>
>     </resource>
>     <resource id="3" name="R1-12.5" short-name="" type="1" units="0" email="" note="" std-rate="12.5">
>       <properties>
>         <property name="cost" value=""/>
>       </properties>
>     </resource>
>   </resources>
>   <allocations>
>     <allocation task-id="12" resource-id="1" units="50"/>
>     <allocation task-id="10" resource-id="2" units="50"/>
>     <allocation task-id="8" resource-id="2" units="100"/>
>     <allocation task-id="12" resource-id="3" units="100"/>
>     <allocation task-id="10" resource-id="3" units="100"/>
>     <allocation task-id="8" resource-id="3" units="100"/>
>     <allocation task-id="6" resource-id="3" units="200"/>
>     <allocation task-id="4" resource-id="3" units="50"/>
>     <allocation task-id="2" resource-id="3" units="100"/>
>   </allocations>
> </project>
> 
> ______________________________________________________________________
> _______________________________________________
> Planner-dev mailing list
> Planner-dev lists imendio com
> http://lists.imendio.com/mailman/listinfo/planner-dev
Index: mrp-task.c
===================================================================
RCS file: /cvs/gnome/planner/libplanner/mrp-task.c,v
retrieving revision 1.3
diff -u -b -B -p -r1.3 mrp-task.c
--- mrp-task.c	6 Apr 2004 20:38:23 -0000	1.3
+++ mrp-task.c	24 Apr 2004 09:29:22 -0000
@@ -1595,7 +1595,7 @@ mrp_task_get_cost (MrpTask *task)
 		resource = mrp_assignment_get_resource (l->data);
 
 		mrp_object_get (resource, "cost", &cost, NULL);
-		total += mrp_assignment_get_units (l->data) * priv->work * cost / (3600.0 * 100);
+		total += mrp_assignment_get_units (l->data) * priv->duration * cost / (3600.0 * 100);
 	}
 
 	return total;

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]