Min max with Alpha Beta pruning

Hey I would like to add Min max with Alpha - Beta pruning for my tic tac toe game. If you know some sort of tutorial or anything please let me know. After I complete I'm going to make a complete guide to make a Tic Tac Toe game with a really nice GUI, Music, AI, and Network capabilities. I have the game made so far. I'm going to rewrite it with interfaces and clean up the code a lot then create the guide, but before I do all this I want to create and AI for it.

I suppose that since, other than reading a summary on Wikipedia, I
don't know what a 'minimax algorithm' is and have never tried to
implement one I should not make fun.The idea is quite simple: your best move e.g. in a board game is my worst
result and vice versa. If I can minimize your best move I have maximized
my best move (and that's the move I'll play).
Now suppose my best move somewhere in that game tree turns out
to be worse than another best move of mine somewhere else in that
same tree, there is no need anymore for me to explore the rest of that
subtree. That's the alpha pruning part. The same counts for you and
that's the beta pruning part.
alpha-beta pruning reduces the number of nodes to be examined to
O(sqrt(n)) where n are all the nodes in the fully examined tree. It is
quite a nice algorithm although quite tricky too when you have to build it.
The best reference I can think of now is the old book "Data Structures"
by Horrowitz and Sahni.
kind regards,
Jos

Similar Messages

  • Help in nega max+alpha beta pruning

    well I have programmed a connect four which implemented minimax algorithm,but then it took 10 secs(minimum) to reply for maxdepth of 8. More over it still lost few games to online ai's which to my surprise played faster and more accurate than my program.Then by searching in books and internet I came across search funtion called as megamax with alpha-beta pruning.I replaced my minimax with this method but then it plays very bad(doesn't even see the connect 4 even if there are 3 in a row).I am willing to put my source code, pls point out my mistakes and rectify (with explanations if possible). Thank you, and also forgive me for grammatical mistakes(if any) as english is my second language.
    I know alpha beta is a bit tedious thing to do(at least for me as I am doing it for the very first time).
    So I request you all to please help

    Here is the source code
    package connect4;
    import java.io.*;
    import java.util.*;
    public class Connect4 {
        private static final int WIDTH=7, HEIGHT=6;
        private static  int MAX_RECURDEPTH=8;
        private static BufferedReader in;
        private  int[][] grid=new int[WIDTH][HEIGHT];
        private  int[] columnHeight=new int[WIDTH];
        private  static int recurDepth=0;
        public static void main(String[] args) {
            in=new BufferedReader(new InputStreamReader(System.in));
            new Connect4();
        public Connect4() {
            Scanner read=new Scanner(System.in);
            int column,p;
            int player=1;
            System.out.println("Who play first?");
            System.out.println("1.Player");
            System.out.println("2.Computer");
            p=read.nextInt();
            player=p;
            double a=-MAX_RECURDEPTH;
            double b=MAX_RECURDEPTH;
            int move=0;
            double value=0;
            Vector moves=new Vector();
            while(true) {
                if(player==1) {
                    printGrid();
                    do {
                        System.out.println("Make your move (1-7): ");
                        column=readInt()-1;
                    } while(column<0 || column >=WIDTH || columnHeight[column]>=HEIGHT);
                } else {
                    moves.removeAllElements();
                    column=0;
                           value=0;
                    double prevValue=-MAX_RECURDEPTH-1;
                    for(int x=0; x<WIDTH; x++)
                        if(columnHeight[x]>=HEIGHT)
                            continue;
                       if (move==0)
                       moves.add(new Integer(3));
                        break;
                      if(p==2 && move==1)
                       moves.add(new Integer(3));
                        break;
                        value=minmax_ab(2,x,a,b);
                        if(value>prevValue) {
                            moves.removeAllElements();
                            prevValue=value;
                        if(value==prevValue)
                            moves.add(new Integer(x));
                       move++;
                       System.out.println("VAlue="+prevValue);
                    if(moves.size()>0) {
                        Collections.shuffle(moves);
                        column=((Integer)moves.get(0)).intValue();
                    if(moves.size()==0) {
                        System.out.println("Its a draw.");
                        break;
                grid[column][columnHeight[column]]=player;
                if(player==2)
                System.out.println("I PUT MY CHECKER IN "+(column+1));
                columnHeight[column]++;
                int haswon=0;
                haswon=fourInARow();
                if(haswon>0) {
                    printGrid();
                    if(player==2)
                        System.out.println("I  WON");
                    else
                        System.out.println("YOU WON");
                    break;
                player=3-player;
        double minmax_ab(int player, int column,double a,double b) {
            double value=0;
            if(columnHeight[column]>=HEIGHT)
                return 0;
            grid[column][columnHeight[column]]=player;
            columnHeight[column]++;
    if(columnHeight[column]>=HEIGHT)
                return 0;
            recurDepth++;
            if(fourInARow()>0) {
                if(player==2)
                    value=(MAX_RECURDEPTH+1)-recurDepth;
                else value=-MAX_RECURDEPTH-1+recurDepth;
            if(recurDepth<MAX_RECURDEPTH&&value==0)
                 value=MAX_RECURDEPTH+1;
                for(int x=0; x<WIDTH; x++)
                  if(columnHeight[x]>=HEIGHT)
                        continue;
                double v=-minmax_ab(3-player,column,-b,-a);
                if(value==(MAX_RECURDEPTH+1))
                        value=v;
                else if(player==2)
                     if(v>value)
                   value=v;
                else if(v>value)
                    value=v;
                    else if(v>a)
                   a=v;
                     else if(a>=b)
                     return value;
            recurDepth--;
            columnHeight[column]--;
            grid[column][columnHeight[column]]=0;
            return a;
        int fourInARow() {
            int num, player;
            for(int y=0; y<HEIGHT; y++) {
                num=0; player=0;
                for(int x=0; x<WIDTH; x++) {
                    if(grid[x][y]==player) num++;
                    else { num=1; player=grid[x][y]; }
                    if(num==4 && player>0)
                        return player;
            for(int x=0; x<WIDTH; x++) {
                num=0; player=0;
                for(int y=0; y<HEIGHT; y++) {
                    if(grid[x][y]==player) num++;
                    else { num=1; player=grid[x][y]; }
                    if(num==4 && player>0) return player;
            for(int xStart=0, yStart=2; xStart<4; ) {
                num=0; player=0;
                for(int x=xStart, y=yStart; x<WIDTH && y<HEIGHT; x++, y++) {
                    if(grid[x][y]==player) num++;
                    else { num=1; player=grid[x][y]; }
                    if(num==4 && player>0) return player;
                if(yStart==0) xStart++;
                else yStart--;
            for(int xStart=0, yStart=3; xStart<4; ) {
                num=0; player=0;
                for(int x=xStart, y=yStart; x<WIDTH && y>=0; x++, y--) {
                    if(grid[x][y]==player) num++;
                    else { num=1; player=grid[x][y]; }
                    if(num==4 && player>0) return player;
                if(yStart==HEIGHT-1) xStart++;
                else yStart++;
            return 0;
        void printGrid() {
            int x=0;
            int y=0;
            for(y=HEIGHT-1; y>=0; y--)
                for(x=0; x<WIDTH; x++)
                    if(grid[x][y]==0)
                        System.out.print(" * ");
                    else if(grid[x][y]==1)
                        System.out.print(" A ");
                    else if(grid[x][y]==2)
                       System.out.print(" B ");
                System.out.println();
            System.out.println();
            System.out.println(" 1  2  3  4  5  6  7 ");
        int readInt() {
            try {
                String input=in.readLine();
                int number=Integer.parseInt(input);
                return number;
            } catch(NumberFormatException e) {
                return -1;
            } catch(IOException e) {
                return -1;

  • Min/Max Planning R12

    Have a real headscratcher!
    Run Min/Max with this set-up:
    Min/Max/Min = 826
    Min/Max/Max = 826
    FLM = 300
    Min Order Qty = 691
    The on hand is 380 and when Min/Max runs we get an order for 691 pieces. Seemingly ignoring the Fixed Lot Multiplier of 300. The thought was we would have seen an order for 900.
    Run Min/Max with this set-up:
    Min/Max/Min = 826
    Min/Max/Max = 826
    FLM = 300
    Min Order Qty = 445
    The on hand again is 380 and when Min/Max runs we get an order for 600 pieces because it "honors" the Fixed Lot Multiplier of 300.
    Seems more like a bug then a feature. Thoughts? Thanks

    Hi Stick,
    As per my understanding,
    In scenario 1:
    =====================
    Min Qty = 826
    Min. Ord. Qty = 691
    On Hand = 380
    So On hand + Mind. Ord. Qty = 380 + 691 = 1071 which is greater than Min. Qty which is 826
    So, in this case, system will not look at the FLM as Min. Ord. is compulsory to place.
    ===========In Second Case========
    Min Qty = 826
    Min. Ord. Qty = 445
    On Hand = 380
    So On hand + Mind. Ord. Qty = 380 + 445 = 825 which is lesser than Min. Qty which is 826
    So it will follow the FLM.

  • ESYU: Min-Max planning을 실행하면 자동으로  ReqImport program이 launch 되지 않는 원인

    Purpose
    Oracle Inventory Management - Version: 10.7 to 11.5.10
    REPORT:INVISMMX - Min-max planning report
    EXECUTABLE:POCIRM - Requisition Import
    Buy items에 대해 Min-Max(with Restock=Y)을 실행하면, 이 program은 ReqImport를
    자동으로 launch 시키지 못하고 단지 po_requisitions_interface_all table에 data를
    insert 한다.
    하지만 사용자는 Min-Max가 실행되면 이후 자동으로 ReqImport가 실행되길 원하고
    있다. 이를 위한 workaround 방법을 소개한다.
    Cause
    ReqImport가 Min-Max 이후 자동으로 실행되는건지, Min-Max에 의해 자동으로 실행되는지
    구분할 필요가 있다.
    ReqImport는 Min-Max에 의해 실행되지 않는다.
    Min-Max의 standard design은 단지 po_requisitions_interface_all table에 data를 넣어
    주기만 할 뿐이지 ReqImport request를 자동으로 실행시키지는 않는다.
    ReqImport는 Min-Max 진행 후 실행될 수 있다.
    왜냐하면 ReqImport는 주기적으로 실행되게 scheudling 되어 있거나, ADS_PO_REQ_IMPORT_TRG1
    와 같은 trigger에 의해 실행된다.
    일부 vision demo instances에서 위 trigger를 볼 수 있는데 이 trigger에 의해 po_requisitions_interface_all
    table에 data가 insert가 되면 ReqImport가 launch 된다.
    Note: 이 Trigger는 standard product이 아니므로 귀사의 instance에서는 찾을 수 없을 것이다.
    Solution
    1. Short-to-medium term solution at your instance:
    1-1) ReqImport가 주기적으로 실행될 수 있게 Schedule 해 놓는다.
    -- or --
    1-2) Min-Max report(Restock=Yes) 실행 후 manual 하게 ReqImport를 실행한다.
    -- or --
    1-3) Min-Max와 ReqImport programs을 포함하는 Report Set을 define 하고, Min-Max 대신
    이 Report set 만을 실행한다.
    -- or --
    1-4) po_requistions_interface_all table에 triggers(similar to ADS_PO_REQ_IMPORT_TRG1)를
    생성한다.
    2. Medium-to-long term solution from Oracle
    ER/Doc bug을 등록하고 metalink를 통해 진행과정을 check 한다.
    2-1) Enhancement Request via ER/Bug 4310485 to have Min-Max Report to fire ReqImport automatically.
    2-2) Documentation Bug 4310487 to have the INV User Guide corrected that Min-Max does NOT create Requisitions,
    but ONLY populates the po_requisitions_interface_all table.
    Reference
    Note 305099.1

  • Avg, Min and Max with a serious twist.....ASO

    Hi,
    I need to calc the Avg, Min and Max on Revenue. That's simple. However Every row of data the revenue falls into a bucket/range. For example revenue is in buckets '0 to 50' or '51 to 100' or '101 to 150' lets say. As I load data I load a '1' into a 'Count' measure depending on which bucket that row of data falls into. So I can get a total count for each bucket. So '0 to 50' might have a Count of 3. '51 to 100' might also have 3 and '101 to 150' has a 2. So my range count looks like:
    0 to 50 - 3
    51 to 100 - 3
    101 to 150 -2
    The trick is they only want the Avg, Min and Max on the rows that makeup the highest 'Count'. In this case that's 3. Problem is there are two ranges that meet this criteria. When that happens they want the Min, Max and Avg of the rows that make up the '51 to 100' bucket since it's the highest range.
    I can easily get the '3' by using the Max formula. So I know what the highest bucket is. Problem is I can't figure out for the life of me, how to pass only those rows that make up the '51 to 100' bucket into the Avg, Min and Max function.....
    I'm stumped and in dire need of something here. I have a spreadsheet that explains the problem better. If somehow I can get a flag on those rows I can easily Avg, Min and Max it. I just can't seem to figure out how to get a flag on only those rows of data.
    I'm willing to share my mocked up example and spreadsheet and .otl and sample data etc....
    Please help :)

    Why does this verify with Min?
    Min ( Filter ( CROSSJOIN ( Descendants ( [Service].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Segment].CurrentMember),
    Filter ( CROSSJOIN ( Leaves ( [Ranges].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Customer Type].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Zip Code].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Disposal Option].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Tickets].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Yardages].CurrentMember),
    Filter ( Descendants ( [Contract Year].CurrentMember),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) ) , [FHRev] )
    And when I just change to Tail and put a 1 at the end it fails?
    Tail ( Filter ( CROSSJOIN ( Descendants ( [Service].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Segment].CurrentMember),
    Filter ( CROSSJOIN ( Leaves ( [Ranges].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Customer Type].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Zip Code].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Disposal Option].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Tickets].CurrentMember),
    Filter ( CROSSJOIN ( Descendants ( [Yardages].CurrentMember),
    Filter ( Descendants ( [Contract Year].CurrentMember),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) )),
    [High Range Max] = ( [High Range Max] , [All FHRev Ranges] ) ) , 1 )

  • DateTimeAxis min/max bug? Problems with consistent padding. Date Wrapping.

    I have been working on a problem with a BarChart object that I've created using dynamic data.
    My primary issue is that I can't seem to get the proper min/max values to set for the chart.
    To solve this I manually found the min and max of the data set of Dates and set the min and max of the chart. This allowed me to finally see all the floating custom bars (each bar is rendered with a user set fill), however now if I have a bar that extends over a year change the horizontal axis labels do not wrap the date properly, so instead of 2/10 (feb 2010) being the last date, 12/09 (dec 2009) is the last date.
    I've been trying to dynamically adjust the padding based upon a change event, but so far to no avail. Partially I think because I'm not sure which event for the function to fire on.
    private function dateAxisGen(r:Array):void {
                    var min:Number = r[0].startTime.time;
                    var max:Number = r[0].endTime.time;
                    const PAD:Number = 2;
                    const MILLISEC_IN_MONTH:Number = 2629743830;
                    const MILLISEC_IN_WEEK:Number = 604800000;
                    const MILLISEC_IN_DAY:Number = 864;
                    for (var i:int = 1; i < r.length; i++) {
                        var o:OperationXT = OperationXT(r[i]);
                        min = Math.min(o.startTime.time, min);
                        max = Math.max(o.endTime.time, max);
                    // Calculates the maximum range, then adds an appropriate
                    // padding to the chart via extra time. TODO
                    /* var range:Number = max - min;
                    if(range >= MILLISEC_IN_MONTH) {
                        dAxis.padding = (MILLISEC_IN_WEEK/1000000)/PAD;
                        dAxis.padding = (MILLISEC_IN_WEEK/1000000)/PAD;
                    } else if(range >= MILLISEC_IN_WEEK) {
                        dAxis.padding = (MILLISEC_IN_DAY)/PAD;
                        dAxis.padding = (MILLISEC_IN_DAY)/PAD;
                    } else {
                        dAxis.padding = PAD;
                    dAxis.minimum = new Date(min);
                    dAxis.maximum = new Date(max);
    this, however, does not adjust the padding properly when an operation is removed from the list. Not to mention I still have the date wrapping error. It gives me the following error:
    Cannot access a property or method of a null object reference.
        at mx.charts::AxisRenderer/measureHorizontalGutters()[C:\work\flex\dmv_automation\projects\d atavisualisation\src\mx\charts\AxisRenderer.as:2244]
        at mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\work\flex\dmv_automation\projects\dat avisualisation\src\mx\charts\AxisRenderer.as:1858]
        at mx.charts::AxisRenderer/adjustGutters()[C:\work\flex\dmv_automation\projects\datavisualis ation\src\mx\charts\AxisRenderer.as:1534]
        at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\work\flex\dmv_automation\pro jects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2239]
        at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\work\flex\dmv_automation\pr ojects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1366]
        at mx.core::UIComponent/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8065]
        at mx.managers::LayoutManager/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:663]
        at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects \framework\src\mx\managers\LayoutManager.as:736]
        at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\ projects\framework\src\mx\managers\LayoutManager.as:1069]
    Any help with my problem would be greatly appreciated.
    ADDITIONAL INFO:
    Alright, so I've discovered that the ONLY time the date wrapping error occurs is when the axis labels contain only the month and year, any other time it places it properly.
    Does anyone know where I can report this bug?

    Perre wrote:I'm used to being able to pick one or a couple of songs and then adding it a specified playlist. Is this impossible in sonata?
    It's clearly not impossible, just different than you expect. Create your playlist as you want it to appear in the Current tab (meaning don't dump every single song from your library in there, just the ones you want) and then save the playlist.
    Perre wrote:And if I try to play the m3u file created (the one with every song listed) through freevo I get a message that the directory is empty. What am I doing wrong??
    Look at save_absolute_paths_in_playlists in your mpd.conf.

  • When firefox 4 is maximized navigation toolbar overlaps with windows 7 buttons up right on the screen(min,max,restore) and overlaps with orange button up left on the screen

    Hi all.
    I have installed firefox 4 and i have an issue which for start i dont know if it is supposed to be so or not.
    When i maximize firefox ,Navigation bar is mixed (shown below) the orange button on the upleft of my screen.Also is shown below of the 3 windows buttons (min,max,close) of the windows 7 in the upperight of my screen.
    Is this supposed to be so?
    I also have some screenshots if you would like to see :
    www.1dagios.com/firefox4-1.jpg
    +
    www.1dagios.com/firefox4-2.jpg
    Thank you for your time reading this and excuse my lame English.
    Regards,
    The_Observer.

    Any news on this.
    I think it has something to do with the add on : Tabgroups manager.
    If i disable this add on then everything works normally.
    Also when this add on is enabled my tabs are always below adress bar ,no matter what.

  • Displaying Max/Min values with time for analog signals.

    I am sampling analog inputs. I simply want to display the max and min values with the time they occurred. This seems simple but I am new to LabView and can't find a Vi to do this.

    Here's the code. When you run the demo program, you'll see three traces: Green is the max so far, Red is the min so far, and White is the current signal value.
    As the input value cycles, you'll see the two limit values track its extremes. If you have any questions about how it works, just holler.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
    Attachments:
    min-max_plotter.vi ‏82 KB
    min-max_tester.vi ‏37 KB

  • How to calculate Min & Max temperature with just air temperature

    Hi Gurus,
    I have a requirement in which I have to build a Bex Query in which I have to find the Min & Max temperature of a day if a specific date range is used in the query.I have checked the multiprovider and there is only one field available
    which is "Air temperature" and it's a KF. I have built a query which will give you the temperature for the day if you give a particular date range.
    My question is,is it possible for me to find the min and max temperature with just air temperature as input?
    Please let me know your thoughts.
    Thanks,
    Raj

    Hi,
    You have to create two KFs for Min and Max temperatures,
    In  Min Temp KF definition, Aggregation Tab-->Minimum--> reference char as 0calday
    In Max Temp KF definition, Aggregation tab-->Maximum-->Reference char as 0calday
    Regards,
    Suman

  • Issue with min/max when vertical axis assigned to multiple series

    Hi.
    I have some simple charting code that is dynamically adding LineSeries to a chart as the user requests them from the gui. As each series is added the vertical axis is assigned to the series and then data is requested and assigned to the dataProvider on the series. This is all working fine however I have found that if I add a sceond series after the first series is displayed and assign the same vertical axis to the second series then the vertical axis seems to set teh min/max based only on the second series added and ignores the first series. It doesnt set to the max of both series and so I get an incorrect max set. If I add a 3rd series the same happens again and the first and second series values seem to be ignored and the axis is set based on the last series to be added.
    Is this expected? Ive tried different variations of invalidating the data/series/styles to force it to refresh but I always get the same. It does refresh but based on only the values in the last added series.
    What is odd is that if I add 2 series at the same time, and assign the axis to both of them and then request data for both and update the dataProvider on both of them the axis is configured correctly based on the max value of both series.
    Any workarounds to make it do the right thing if they are added dynamically? Is this a bug or a known "feature"?
    Any light anyone can shed would be appreciated.
    I need to have the axis assigned to the series directly as I want to be able to use multiple axes. I have found that if I set the verticalaxis on the chart rather than the series then it works fine and sets the min/max based on the combined values of both series.
    The vertical axis is just a simple LinearAxis.
    Any help or suggestions would be appreciated.
    Im using Flex 4.1
    Tks
    Dan

    Adobe Flex LiveDocs seemed to indicate "Using multiple series in the same chart works best when the data points are in a similar range (such as a stock price and its moving average). When the data points are in numerically very different ranges, the chart can be difficult to understand because the data is shown on a single axis. The solution to this problem is to use multiple axes, each with its own range. You can plot each data series on its own axis within the same chart using the techniques described in Using multiple axes" and that link is here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_11.html
    I was going to tae a look at this myself, but the code posted here is quite complex, and I suspect incomplete.
    If you refer to that link and still cannot solve the issue, I would try your best to boil down your code to a more simple example still exhibiting the issue, and then post that, along with any data and the simplified main app.
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • [svn:fx-trunk] 12552: DataGroup now tracks the indices of the active virtual item renderers with a list , rather than the min/max values.

    Revision: 12552
    Revision: 12552
    Author:   [email protected]
    Date:     2009-12-04 13:45:12 -0800 (Fri, 04 Dec 2009)
    Log Message:
    DataGroup now tracks the indices of the active virtual item renderers with a list, rather than the min/max values. 
    DataGroup/addItemRendererToDisplayList() now respects the overlay.
    QE notes:
    Doc notes:
    Bugs: sdk-24052
    Reviewer:
    Tests run: DataGroup, List
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/sdk-24052
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as

    Hello Martin:
    Thanks for your input.  However I am not certain we have resolved this issue adequately, or understand the principles governing the css as regards this spry menu framework 2.0 (1.0).
    For example, the menu only works in IE 6.0 if the css remains in the head.  I agree with your original post that it shouldn't make any difference whether the css is posted in the head or in a separate style sheet (so long as specificity issues are addressed).  Both should work -- and yet it doesn't.
    If the CSS is placed in the separate style sheet governing the total site, it doesn't work for 6.0.  If placed at the top of the style sheet, conflicts of specificity prevent the menu from rendering properly in any of the browsers causing the rules for general links to govern the menu.   This has been verified using a cross browser testing.  If the styles are placed at the bottom of the style sheet to help them take precedence, they work in all the browsers except for IE 6.
    The website I am building needs to support IE 6 for a variety of reasons, and because it is catering to the non-profit community and to low income persons, I am mindful of even small differences in page weight.
    So for me, at least, the issue remains baffling.
    I appreciate your input, but also would appreciate the input from others, and especially Adobe Community Professionals and employees.  The spry framework in this regard is not well documented.  I am not certain if this is exclusively a CSS problem, if it might also be complicated by the architecture of the spry framework, or if indeed other variables are at play.
    I would be my hope that in resolving the problem, other users of the this particular spry framework might also benefit.
    Thanks,
    Steve.

  • Need some help with the DOF Min Max Planning Logic

    Hello All,
    Morning...could someone please help us with this issue which we are facing in our production system.
    We are running the Dof Min Max Planning Report at the Subinventory level and for a given item.
    This item setup in this sub inventory has the Min qty : 2 , Max qty :2.
    --We don't see any open orders/ requisitions in the system for this item.
    --We also don't see any expected receipts for this item coming to this org/subinventory.. All the shipment lines are in Fully Received status.
    --We dont see any stuck supply records in mtl_supply table as well..and also checked for the Inv Transactions interface tables as well ( MTI , mtl_material_transactions_temp)..we dont find any stuck transactions for this item, subinventory & org.
    Now when we are running the Dof Min Max report is is showing the Supply Quantity as 2 and Available Quantity as 2.
    Hence the Reorder quantity is coming as Zero..basically it is not re stocking the item again for this subinventory level.
    Could someone please assist as to what could be reason why this Supply Quantity is showing some value when we dont see any stuck supply / expected open receipts..
    What else we need to check here to get this issue resolved and to know the source of the Supply Quantity.
    thanks

    In the report run, what parameters are considered as Supply?, Also did you check the supply data considering your cutoff dates offset?, the item what you are talking about is a buy item? check if there were requisitions already created.

  • Need help with min max sql

    hi all, forgot i had a user name and password and haven't needed help for quite a bit since i didn't do sql for a while but now i'm back at reporting again...
    Here is a sample table as i remember it:
    Item     Date     Time     Time Frame     Duration     Duration Frame
    A     20100926     0     5     500     10
    A     20100926     600     10     500     30
    A     20100926     1500     12     100     30
    B     20100926     1800     28     200     40
    B     20100926     2200     6     150     70
    B     20100926     2600     15     600     60
    B     20100926     3600     30     200     70
    Results Set (expected):                         
    Item     Date     Time     Total Duration          
    A     20100926     0     1600:20     --basically max (time+duration) - min(time+duration)     
    B     20100926     1800     2000:00
    Sorry, but. I didnt put my sql statement as I wasn't planning on posting and left it at work, but, i've been looking on internet and people say to use min/max function and i've attenpted it with it works with just this table (without grouping). But as soon as i group it the values seem to mess up.
    Last i remembered it gave me:
    Item     Date     Time     Total Duration          
    A     20100926     0     1600:30     --basically max(time+duration) - min(time+duration)     
    B     20100926     1800     2000:70
    I think it's looking at max duration which is 30&70 and hence it retrurns those values in the result set. Is it because of the max function hence it's returning this value? any help is appreciated. thanks
    Edited by: stanleyho on Sep 30, 2010 4:44 PM

    Okay, here we go again, repost, hopefully okay this time:
    Hi Madhu, okay, just got to work: I am using TOAD and working in Oracle 10g. Here is my table structure and the query i use to try and get what I am looking for:
    There is one extra table but that is only used to link these two tables listed below so i didn't bother posting it.
    TABLE: TX_RECON_INSTANCE_VIEW
    ColumnName ColID DataType Null
    CHANNEL_CODE 3 VARCHAR2 (4 Char) N
    DURATION 8 NUMBER (10) N
    DURATION_FRAME 9 NUMBER (2) N
    REAL_TIME 6 NUMBER (10) N
    REAL_TIME_FRAME 7 NUMBER (2) N
    ITEM_ID 4 NUMBER Y
    TX_DATE 2 CHAR (8 Byte) N
    TX_ID 1 NUMBER (9) N
    TX_TYPE 13 VARCHAR2 (4 Char) N
    TABLE: TX_SCHEDULE
    ColumnName ColID PK Null DataType
    TX_TYPE 22 N VARCHAR2 (4 Char)
    TX_ID 1 1 N NUMBER (9)
    TX_DATE 2 N CHAR (8 Byte)
    SCHEDULE_TIME_FRAME 9 N NUMBER (2)
    SCHEDULE_TIME 8 N NUMBER (10)
    REAL_TIME 10 N NUMBER (10)
    DURATION_FRAME 13 N NUMBER (2)
    DURATION 12 N NUMBER (10)________________________________________
    And the data and results:
    TX_ID TX_DATE REAL_TIME REAL_TIME_FRAME DURATION DURATION_FRAME ITEM_ID AS RUN TIME AS RUN DURATION SCHEDULED TIME SCHEDULED DURATION SCHEDULE_TIME SCHEDULE_TIME_FRAME DURATION_1 DURATION_FRAME_1
    1651000 20100710 0 0 545 20 1234 00:00:00:00 00:09:05:20 00:00:00:00 00:09:05:20 0 0 545 20
    1752223 20100710 667 12 281 7 1234 00:11:07:12 00:04:41:07 00:11:07:10 00:04:41:07 667 10 281 7
    1846501 20100710 1071 13 335 9 1234 00:17:51:13 00:05:35:09 00:17:50:09 00:05:35:09 1070 9 335 9
    2001102 20100710 1525 6 249 14 1234 00:25:25:06 00:04:09:14 00:25:22:08 00:04:09:14 1522 8 249 14
    3246669 20100710 1800 0 586 2 1235 00:30:00:00 00:09:46:02 00:30:00:00 00:09:46:02 1800 0 586 2
    4456822 20100710 2492 16 276 5 1235 00:41:32:16 00:04:36:05 00:41:32:16 00:04:36:05 2492 16 276 5
    1253168 20100710 2890 15 222 17 1235 00:48:10:15 00:03:42:17 00:48:10:15 00:03:42:17 2890 15 222 17
    1112456 20100710 3277 18 297 0 1235 00:54:37:18 00:04:57:00 00:54:35:10 00:04:57:00 3275 10 297 0
    Grouped results set:
    TX_DATE ITEM_ID AS RUN TIME AS RUN DURATION SCHEDULED TIME SCHEDULED DURATION
    20100710 1234 00:00:00:00 00:29:34:20 00:00:00:00 00:29:31:20
    20100710 1235 00:30:00:00 00:29:34:17 00:30:00:00 00:29:32:17
    --> SCHEDULED DURATION "00:29:31:20" is not correct as it should be (00:25:22:08+00:04:09:14)-(00:00:00:00)=00:29:31:22
    --> see expected results below
    Expected results:
    TX_DATE ITEM_ID AS RUN TIME AS RUN DURATION SCHEDULED TIME SCHEDULED DURATION
    20100710 1234 00:00:00:00 00:29:34:20 00:00:00:00 00:29:31:22
    20100710 1235 00:30:00:00 00:29:34:18 00:30:00:00 00:29:34:10________________________________________
    And the query I am using:
    SELECT --TXR.TX_ID,
    TXR.TX_DATE, TXR.ITEM_ID,
    TO_CHAR(TRUNC((MIN(TXR.REAL_TIME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) )/3600),'FM00')||':'||TO_CHAR(TRUNC(MOD(MIN(TXR.REAL_TIME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) ,3600)/60),'FM00')||':'||TO_CHAR(MOD(MIN(TXR.REAL_TIME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) ,60),'FM00')||':'||TO_CHAR(MOD(MIN(TXR.REAL_TIME_FRAME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) ,60),'FM00') "AS RUN TIME",
    to_char(trunc((MAX(TXR.REAL_TIME+TXR.DURATION)-MIN(TXR.REAL_TIME))/3600),'FM00')||':'||to_char(trunc(mod(MAX(TXR.REAL_TIME+TXR.DURATION)-MIN(TXR.REAL_TIME),3600)/60),'FM00')||':'||to_char(mod(MAX(TXR.REAL_TIME+TXR.DURATION)-MIN(TXR.REAL_TIME),60),'FM00')||':'||to_char(mod(MAX(TXR.REAL_TIME_FRAME+TXR.DURATION_FRAME)-MIN(TXR.REAL_TIME),60),'FM00') "AS RUN DURATION",
    TO_CHAR(TRUNC((MIN(TXS.SCHEDULE_TIME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) )/3600),'FM00')||':'||TO_CHAR(TRUNC(MOD(MIN(TXS.SCHEDULE_TIME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) ,3600)/60),'FM00')||':'||TO_CHAR(MOD(MIN(TXS.SCHEDULE_TIME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) ,60),'FM00')||':'||TO_CHAR(MOD(MIN(TXS.SCHEDULE_TIME_FRAME) KEEP (DENSE_RANK FIRST ORDER BY TXR.REAL_TIME) ,60),'FM00') "SCHEDULED TIME",
    to_char(trunc((MAX(TXS.SCHEDULE_TIME+TXS.DURATION)-MIN(TXS.SCHEDULE_TIME))/3600),'FM00')||':'||to_char(trunc(mod(MAX(TXS.SCHEDULE_TIME+TXS.DURATION)-MIN(TXS.SCHEDULE_TIME),3600)/60),'FM00')||':'||to_char(mod(MAX(TXS.SCHEDULE_TIME+TXS.DURATION)-MIN(TXS.SCHEDULE_TIME),60),'FM00')||':'||to_char(mod(MAX(TXS.DURATION_FRAME),60),'FM00') "SCHEDULED DURATION"
    FROM TX_RECON_INSTANCE_VIEW TXR, TX_SCHEDULE TXS, TX_SCHEDULE_RECON TXREC
    WHERE TXR.TX_DATE=20100926 AND TXR.TX_TYPE='P'
    AND TXR.TX_ID=TXREC.RECON_TX_ID(+)
    AND TXREC.BASE_TX_ID=TXS.TX_ID(+)
    GROUP BY TXR.TX_DATE, TXR.ITEM_ID
    ORDER BY TXR.TX_DATE, TXR.ITEM_ID, MAX(TXR.REAL_TIME)--does this work for everyone now? let me know...thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Can we use MRP to plan for FERT in-house produced  with PIR's & has Min/Max

    Hi SAP Guru's
    I have a very critical issue from the client who wants to use MIN/ MAX stock values for planning its finished products (in-house produced)
    <b>here is the details of the scenario</b>
    Client recieves 2 Excel files every week from customer
    <b>1st</b> file contains the Weekly Demand Forecast of FERT material for next 1 year and they upload it in MD61 as PIR's <u><b>BUT</b></u> this value is also <u><b>Inclusive</b></u> of Safety stock value (<b>ex: if weekly demand entered in MD61 as PIR is 50 and if safety stock value is 10, then actual demand is only 40)</b>
    <b>2nd</b> file send contains only <b>safety stock values</b> (for ex in this case let it = <b>10</b>) to be maintained for the FERT materials
    the client wants MRP to plan and trigger based on this PIR's in MD61 and Safety stock level fand plan for FERT, HALB and also ROH materials as defined in the BOM also taking into consideration the current WIP levels (Work in progress for any existing production orders currently being processed) based on the production Lead times values maintained
    so what the client wants is they want to maintain 2 stock values, that is one least stock value and other higher value which if stock falls below this point, will trigger production based on the lead time and considering any WIP levels also
    <b>(for ex in this case if PIR = 50 and safety stock is 10, MRP run result client wants is = 30 and NOT =40)</b>
    so here are my questions
    1. is this scenario feasible? use safety stock and min/max level for in-house produced finished which has demand PIRs in MD61 at the same time?
    2. Also due to SOX complaince regulations, the client does not want to change the forecast values in MD61, so is it possible to make some settings so that forecast is corrected by WIThOUT including the safety stock value in it? ( for ex: in this case as = 40 only and NOt as 50)
    3. which all settings should i maintain like for MRP type or lot size or stock qty levels or anyother customizations if any required so that when we run MRP, can it ignore the safety stock value and generate the client desired output?
    thank u verymuch for your time & expert advice in advance

    Hi Chakri,
    This is not possible as per standard functionality. MRP always creates proposals for the shortage quantity of the safety stock. We have used the user exit in the plant level MRP run to exclude both plant and safety stock in the net requirements calculation.
    You have to write logic to convert the safety stock into plant stock in the user exit so there will be no additional procurement proposals...you can create custom indicatar in materail master or linked any existing indicator like MRP group to the user exits so the MRP will checks this and will not create proposals for the selected parts.
    If you have any questions then please inform.
    Regards
    TAJUDDIN

  • FF9 - can i hide window control buttons in titlebar (min, max, close) with userchrome.css?

    I use FF9. In userscript.css i hide titlebar and orange app button, but window control buttons still visible! I just can`t find working script.
    I dont need min-max-close button and wont to hide it without extension if possible.
    Here is screenshort:
    http://s018.radikal.ru/i522/1201/50/f6a6ea445507.jpg

    Try this code in userChrome.css below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    The customization files userChrome.css (interface) and userContent.css (websites) are located in the chrome folder in the user profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    <pre><nowiki>*http://www.mozilla.org/en-US/firefox/channel/
    #titlebar-buttonbox { display:none!important; }
    </nowiki></pre>

Maybe you are looking for

  • Black screen with blinking cursor in top lefthand corner

    7 months ago I got the recovery virus, CherylG helped me by recommending and giving directions to use the Kaspersky Rescue disk.  I ran this and my Pavilion Notebook worked fine.  Now it has returned.  I tried re-running the Kaspersky Rescue disk.  I

  • Huge load on Database server

    Hello all, Good day. We are using oracle standard edtion 9.2.0. We have sun machine with dual cpu and have 8G memory. We use decicated server for our web applications. We also use SharePlex for replication. The average number of logins (users) in the

  • Detail-with-two-masters : Is there a demo ?

    Hi all, I found in the manual following description and I think this could be a solution for many-to-many related Forms blocks (intersection table=detail) : A detail-with-two-masters relation involves a single detail block that has two master blocks.

  • Can you edit the HOSTS file on an iphone?

    Is there a way to edit the iPhone equivalent of an /etc/hosts file?  This is necessary to access some internal test/dev resources on our network.  Jailbreaking is NOT an option.  Creating and installing configuration profiles via the iPhone Configura

  • There is no scroll bar showing on i itunes

    there is no scroll bar in itunes on vista new download 25/1/13