Designing a routing system

Hi...
I'm trying to design a routing system for a food factory. There are 3 procssing machines, and 2 packing machines.
Food is moved along 'queues', and the routing system accepts food from a processing machine, it then asks the packing machine 'which is the shortest queue', and gives the food to that machine.
The machines are in charge of interacting with the queues, The routing system only deals with the machines. I've created an array of only two packing machines in the constructor, and have just on method called run, which will deal with the rest.
the class simply needs to have a method that accepts object, and then it simply asks each machine how long the queue is and puts this object onto the shortest.
I'm having trouble getting started on this, and would appreciate any help.
Cheers

In a similar vein:
public class machine {
   Queue q;
   String name;
   public Machine( String name ) {
      q = new Queue();
      this.name = name
}and...
public class packingMachine extends machine {
   public packingMachine( String name ) {
      Super( name );
}and since a Queue object can be implemented as a Vector, a linked list, an array... I will leave it up to you to decide what's the best way to create a Queue object.

Similar Messages

  • Designing a chat system

    hi
    im trying to design a chat system that will be used in chat.class and i dont know where to start about learning how to desgin a chat system. i dont need it to use a pop up i would have to run on the main applet any help.. ehh sorry

    eg #1
    http://forum.java.sun.com/thread.jspa?forumID=31&start=0&threadID=287509&range=100

  • Temporarily routing System.out and System.err to a String

    Hi everybody,
    Does anyone know of a way to temporarily route System.out and System.err directly from the console into a String, then set it back to its default to the console? I know how to reroute to a text area:
    TextAreaOutputStream taos = new TextAreaOutputStream(yourTextArea);
    PrintStream ps = new PrintStream(taos);
    System.setErr(ps);
    System.setOut(ps);But it doesn't seem like there is either a way to reroute to a String or a way to switch back to the default routing afterward. Can anyone give me some advice on how to do this, please?
    Thanks,
    Jezzica85

    Too late to the party?
    import java.io.*;
    public class Redirection {
        public static void main(String[] args) {
            System.out.println("To console");
            PrintStream old = System.out;
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            PrintStream ps = new PrintStream(baos);
            System.setOut(ps);
            System.out.println("To memory");
            System.out.print("No 'ln'");
            //System.out.flush(); //needed?
            System.setOut(old);
            System.out.println("To console again?");
            System.out.println("earlier I wrote...");
            byte[] data = baos.toByteArray();
            String message = new String(data);
            System.out.println(message);
    }

  • Help needed to design Greenhouse control system

    Has anyone designed a complete system with weather station, nutrient mixing etc

    Kahlid,
    I would appreciate some help with my greenhouse.  I'm just getting ready to design a small facility to learn on.  I have a lot of LV experience and want to use that to build an automated greenhouse for house plants.  Any help or info on where to obtain some help would be greatly appreciated.
    Thanks,
    Hal Curling

  • DataBase Design For Inventory Systems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Inventory Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • How to access report designer in customer system

    How to access report designer in customer system as we dont have direct acces to Customer BI System. Is there sny transaction code for report designer/web application designer or we can go through RRMX.
    Thanks in Advance.

    Hi
    If I got your question properly, You need authorization for the accessing Client System. You can see the Reports at RSRT , RRMX may also lead to Query Analyser.
    Hope it helps

  • SAP ROUTER SYSTEM

    Dear All,
    PC on which sap router software is installed to access sap remotely is corrupted. we want to format that Pc.
    is it necessary to communicate SAP before formatting.
    Also tell me steps to configure router software after formatting.
    rgds

    Make sure you give the same hostname to the router system as SAP has already registered your router at :
    http://service.sap.com/saprouter-sncadd
    Once you have repeated the router installation, make sure you repeat the certificate requesting and import through service mearketplace for the SNC.
    http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000044248&_SCENARIO=01100035870000000202&_OBJECT=011000358700003588172003E
    And once its completed, make sure you test the connection with SAP.
    Regards,
    Jazz

  • Transparent design with router on both sides?

    I am looking to solve a design which has to work in two scenarios. Preferably with an in-line solution.
    1. Transparent design with VRF on both sides:
    FW-VRF (Subnet A)
          |
          | (VLAN 11)      | ACE (Subnet A)
          |
          | (VLAN 12)
          |
    LAN-VRF
          |
          |  (VLAN 13)
          |
    Real servers (Subnet B)
    2. Transparent design in plain bridge mode
    FW-VRF (Subnet A)
          |
          | (VLAN 11)      |
       ACE (Subnet A)
          |
          | (VLAN 12)
          |
    Real servers (Subnet A)
    As mentioned, I am aiming for a single design for both scenarios. A routed design will not pass in the first scenario and a one-arm solution will be inefficient in the second scenario. (both due to existing infrastructure) Is it possible to solve this with a transparent solution in both scenarios? I can't seem to get it to work.
    Thanks in advance for any help!

    I'm gonna expand my question a bit as I can not seem to get a working config in scenario 1. From the ACE I can ping the VRFs on both side of the ACE. I can on the other hand not ping neither the bvi-address of the ACE nor one VRF from the other. Can anyone notice any immediate errors in my config? Thanks in advance for any help!
    Addresses:
    10.3.66.1 - FW_VRF on client side
    10.3.66.6 - LAN_VRF on server side
    10.3.66.7 - BVI if on ACE
    ===Admin===
    resource-class TEST_res
    limit-resource all minimum 10.00 maximum unlimited
    boot system image:c4710ace-mz.A3_2_0.bin
    hostname 4710Appl
    interface gigabitEthernet 1/1
    description Management port
    switchport access vlan 752
    no shutdown
    interface gigabitEthernet 1/2
    description Client side LAN
    switchport trunk allowed vlan 2522
    no shutdown
    interface gigabitEthernet 1/3
    description Server side LAN
    switchport trunk allowed vlan 2524
    no shutdown
    interface gigabitEthernet 1/4
    shutdown
    access-list BPDU ethertype permit bpdu
    access-list ALL line 8 extended permit ip any any
    access-list everyone line 8 extended permit ip any any
    access-list everyone line 16 extended permit icmp any any
    class-map type management match-any REMOTE_ACCESS
    description Remote access traffic match
    2 match protocol ssh any
    3 match protocol icmp any
    4 match protocol snmp any
    policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY
    class REMOTE_ACCESS
    permit
    interface vlan 752
    description Management VLAN
    ip address 10.7.52.63 255.255.255.0
    service-policy input REMOTE_MGMT_ALLOW_POLICY
    no shutdown
    ip route 0.0.0.0 0.0.0.0 10.3.66.1
    context TEST_context
    allocate-interface vlan 752
    allocate-interface vlan 2522
    allocate-interface vlan 2524
    member TEST_res
    context TEST_context_routed
    username admin password 5 $1$bale5EiS$bEdquz.bbcW3wRcfeSzbu/  role Admin domain
    default-domain
    username www password 5 $1$bsOdgxav$1uywtkwFEj3QalKaOTrkZ1  role Admin domain de
    fault-domain
    ssh key rsa 1024 force
    ===Application context===
    access-list ALL line 8 extended permit ip any any
    access-list ALL line 16 extended permit icmp any any
    class-map type management match-any REMOTE_ACCESS
    description Remote access traffic match
    2 match protocol ssh any
    3 match protocol icmp any
    policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY
    class REMOTE_ACCESS
    permit
    interface vlan 752
    ip address 10.7.52.64 255.255.255.0
    service-policy input REMOTE_MGMT_ALLOW_POLICY
    no shutdown
    interface vlan 2522
    description Client side VLAN
    bridge-group 1
    access-group input ALL
    access-group output ALL
    no shutdown
    interface vlan 2524
    description Server side VLAN
    bridge-group 1
    access-group input ALL
    access-group output ALL
    no shutdown
    interface bvi 1
    ip address 10.3.66.7 255.255.255.240
    no shutdown
    ip route 0.0.0.0 0.0.0.0 10.3.66.1

  • SharePoint Designer Workflow 2010 - System Account Initiator

    I am current running SharePoint 2013. I have a drop-off library which routes documents to the correct location. But when I use the drop-off library the workflow initiator shows up as "System Account". When the document is added to the SharePoint 2010
    Workflow fails (I've been able to get 2013 Workflows to work but I really need SharePoint 2010 Workflow for this scenario).
    How can I solve this problem? Is there a setting I can change? Or even change the Workflow initiator?

    Hi Spupload,
    It is by design that Content Organizer rule will route documents with System Account and 2010 workflow cannot be triggered by system account.
    I recommend to start the workflow programmatically with Event Receiver.
    You can refer to the links below for detailed codes:
    http://blog.ozippy.com/2010/06/starting-workflow-when-content.html
    http://zimmergren.net/technical/starting-a-sharepoint-workflow-from-code-event-receiver
    Best regards.
    Thanks
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Designer Workflows with System Account

    Hi..
    I created a SharePoint List Workflows using SharePOint Designer and i want to know the reason why workflow not working for
    System Account and for remaining users it working fine.
    Ravindranath

    Check these links...you may find your answer here...
    http://blogs.msdn.com/b/sowmyancs/archive/2009/03/31/issue-with-sharepoint-designer-workflow-to-start-under-system-acccount.aspx?Redirected=true
    https://blogs.technet.com/b/victorbutuza/archive/2009/03/14/workflows-do-not-start.aspx
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

  • How do I route system sounds to USB audio?

    I own An M-Track USB audio interface.  Music, Videos, and Applications in general all route audio to this device properly.  In sound settings, both Input and Output are set to the M-Track.  The problem is that system sounds specifically still route to the built in speakers.  This is a problem since a lot of my work is done overnight while my wife is sleeping.  These random sounds wake her up.  Please help me figure out how to fix this.

    I appreciate the answer, but if you read my question thoroughly you will notice this: "In sound settings, both Input and Output are set to the M-Track"
    Most audio routes properly.  It is strictly system notifications (New emails, File transfer completed, etc) that routes to the internal audio.

  • Query Designer Issues Post System Copy

    Hi All -
    We have just performed a system copy from our production to our QA systems.  Now, when we trying to view a report from Query Designer in our QA environment, we are being prompted for a username and password - which is trying to log in to our production environment!  (I know this because I locked myself out of production trying to log in via our QA Query Designer).  We've done all the BDLS runs, updated the RSLOGSYSDEST table poer OSS note 524554, and also updated the tRFC port in WE20.  What do we need to do to be able to run a query out of the BW QA system?
    Thanks for the assistance.
    Abby

    Hi Abby,
    Once you execute the query from designer you will get one URL generated in the explorer address bar here you will have to change the name of your production app server with quality app server then report will be executed on quality server.
    But this is temporary solution, you will have to check with your basis team regarding this and they will have to change some setting in system table and next time onward the system will pick proper URL.
    Regards,
    Durgesh.

  • Database structure : How to design the track system of a railway station

    Dear Oracle experts,
    I'm interested in your opinion about a database design problem.
    I want to design a database which describes e.g. the tracks of trains in
    a big railway station with many switches. What I always know is the position of every switch in my railway station.
    If I know all of the present switch-positions I know automatically where a train which is at a certain position would move.
    In my database I would like to store these pathways and search the pathway of train at a certain position and the present switch positions.
    One problem is that if one of the switches is at a position which leads to a pathway which would the train drive round the next switch the position of the next switch would be uninteresting. Since I have to search the table with my pathways with my set of switch positions I willl have to put datasets for all positions of the circumscribed switch
    into my table.
    Exampel :
    I have 3 switches. If switch 1 is at position 1 switch 2 is circumscribed and the train drives to switch 3. If switch 1 is on position 2 the train drives to switch 2. If switch 2 could have 10 positions then I would have to create datasets for all the 10 positions of switch 2 for all positions of switch 1 although these positions are not always interesting.
    To solve this problem I would like to describe some kind of search tree in my database structure. Does someone of you have an idea how to solve this problem ?
    Best ragards,
    Daniel

    Hirachical is interesting, but you pay a big performance/feature penalty by using it.
    If this is a real train station, then changes probably won't be done on the tracks for a long time, and if so, it's a rare event that your program may not need to be able to handle dynamically?
    If that, then your DB becomes simple ... have a table of tracks coming into the station, and another list of tracks going out. Maybe also "destination tracks" within your station.
    Then simply have a table that takes a source/destination pair of tracks, and then a column for each switch. The column holds the setting of the switch to provide the path between source and destination.
    Then you have a simple and fast query access. It's rather easy to turn the table for reporting if you want a more dynamic query access; but I guess your main need for the system is to ask "what do my switches need to be set at if a train needs to go from point A to point B". If so, a simple table layout as above is going to be your solution. And it's going to be fast and efficient.
    Only if you dynamically want to be able to design the track layout does this become a harder problem. But you could still use the same "construct":
    Table: Destination Pairs
    PairID Number
    FromTrack Number references tracks
    ToTrack Number references tracks
    Table: Switch settings
    SwitchID Number references Switches
    PairID number references Destination Pairs
    SwitchSetting number
    primary key: SwitchID, PairID
    Now your query is a join - but it's possible to simply list all the switch settings on a given pair. No need for hirachical queries.

  • How to design a file system based on java card

    I have reviewed all kinds of articles about it.And right now I can not find any source code to do that function.But how to design a full gsm file system using java card.
    of course you need fast access,dynamic allocate memory,file properties management.Let's talk about it.

    just do it.
    there is no such feature in the javacard api. This must be coded by hand, you have to manage memory, etc.
    I know, that's not cool.

  • Grouping collected versions of Designer 6 application systems in 10g

    Hello,
    I wasn't sure how to make the Subject clear, hopefully I'll explain my problem anyway.
    I'm testing the migration of application systems from Designer 6 to Designer 10g. Some of the v6 application systems are versioned in the sense that we created new versions and froze the current one, i.e in the RON, select Application > New Version in v6. So, we may have several 'versions' of an application system called TEST, i.e.
    TEST (1)
    TEST (2)
    TEST (3)
    ... and so on to TEST (X). X is live, the rest are frozen.
    In the 10g RON, each version (all frozen and live) of TEST appears as a separate Container in its own right. Imagine we have this situation with other named application systems we've migrated - we're dealing with a big list in the RON.
    What I want to do is group all my TEST containers under a 'TEST' top level container to make navigating a bit easier (so I can expand the top level only if I want to see all the versions underneath). I did this and used the option 'Copy Application System' to copy TEST (1) and TEST (2) into this TEST top level. Unfortunately the audit info for TEST (1) and TEST (2) under the new TEST container has been lost - they now have today's date. As they're copies, I still have TEST (1) and TEST (2) as explicit Containers in their own right, but I can't see how to group them as I'd like without losing this audit info.
    So - is this possible? If so, what am I doing wrong?
    Hope I've explained myself. I should add we're not switching versioning on in 10g yet, so we've the GLOBAL_SHARED_WORKAREA for the moment.
    Thanks, Antony

    Michael,
    Thanks again. We need to bring older versions of the frozen application systems, e.g. TEST(4), as we have interdependencies with other application systems (in terms of shared objects). Otherwise we would have only brought the latest versions over to simplify things.
    When you say at the end of your reponse to 'start the SCM's method of versioning', you're talking about switching the versioning on in 10g, right? We were going to migrate our v6 content and use the GLOBAL_SHARED_WORKAREA for the moment, and enabling versioning and all that entails would be the next phase.
    Antony

Maybe you are looking for

  • IPad 2 is not picking up current location.  All settings seem correct.

    iPad is not picking up current location for use in apps requiring it.  It was ok prior to downloading the OS 5 upgrade.

  • Burn error... ugh!

    I have 8.4GB of content that I am attempting to author for dvd-9. My test burn keeps failing with the following error: "A suitable marker could not be found in the required layer break range" I have my layer break set to "automatic" but it fails. I t

  • Mvmt UU to QI with QM active

    Hi, QM is active for the material but I still want to be able to post it from UU stock to QI stock via 322. I created a copy of the mvmt type and flagged "QM not active" in QMJJ. But I'm still not able to post the movement, I get the error "Change th

  • Error opening MPEG-2 in FCP and QuickTime

    I have an MPEG-2 elementary stream file created with Digital Rapids Stream under Windows. I get an error, "file unrecognized" when attempting to open the file with QuickTime Pro 7 and Final Cut 5. The error code was -2048. I have the MPEG-2 player co

  • Hcm certification

    Hi all certified gurus I want to do certification in SAP HCM.but i m unable to gte the correct material number.i have all the new materials like HR110, HR310, HR315 etc......... can u tell me all the document number required for certification and how