Dynamic 2-D map for A*search pathfinding problem

The Problem is a Dynamic map (the user can change size of the map) that has obstacles(obstacle location determined by the user also) and the tile could only move to adjacent tiles(only 4 moves or less), Can anyone solve that in Java? (without visualization only sample code).

basically im trying to match the value of one Map with the key of another. my thinking is that this requires me to loop through the first Map and for each value through the second Map and match up the key to it. heres my code so far:
private static Map equiJoin(Map relation1, Map relation2) // The 2 maps
Map resultRelation = new TreeMap();
Iterator keys1Iterator = relation1.keySet().iterator();
Iterator values1Iterator = relation1.values().iterator();
while (keys1Iterator.hasNext() ) // Loop through relation1
String primaryKey1 = (String) keys1Iterator.next();
String foreignKey1 = (String) values1Iterator.next();
List list = new ArrayList();
Iterator keys2Iterator = relation2.keySet().iterator();
Iterator values2Iterator = relation2.values().iterator();
while (keys2Iterator.hasNext() ) // Loop through relation2
String primaryKey2 = (String) keys2Iterator.next();
String foreignKey2 = (String) values2Iterator.next();
if(primaryKey2.equals(foreignKey1))
list.add(foreignKey1);
list.add(foreignKey2);
resultRelation.put(primaryKey1, list);
return resultRelation;
im trying to come up with ways to make this faster, perhaps by turing the second while loop/linear search into a binary search. i do indeed think using the get(key) more would increase the speed but im still thinking about ways to implement that in the above code, the problem being that i dont know what key im looking for until i loop through it (if u know what i mean) =)
many thanks.

Similar Messages

  • Menu map for 6070

    Hi.
    I'm looking for the Manu map for Nokia 6070
    My problem is that the display of the phone is broken, It doesn't show anything, but otherwise the phone works well, I can call, or recieve calls.
    Before I take it to repair, I would like to connect to my notebook to synchronize data. The only way I could do it is to activate Infrared, but for this I need the menu map.
    Thanks,
    frog

    I have a similar problem -
    I have a new 7360 - in hong kong. The guy in the shop showed my wife that it has english language installed. Then when we take the battery out to insert the SIM card it defaults back to Traditional Chinese.
    and nowhere - but nowhere - (Google, MSN, Nokia.com) is there a simple instruction "press menu 1,2,3 to change the language to XXX".
    Looking on the forums there are other people with the same issue - Arabic/English , Malay/Indonesion etc
    I mean really - you sell millions of phones with multiple language support so this problem must come up and **bleep** your customers off hundreds of times daily.
    Think about it - the reason people want to change a language is because they cant read the one that the phone is displaying! So putting "Press menu, then settings, then language" is useless because we cant read the phone display and the menu selection varies from model to model.
    Please - if anyone with access to an english language 7360 reads this - can you send the menu selection to change language to flippertie [at] yahoo [dot] com.
    thanks

  • Error while mapping a Java class for a Search Dialog Box component

    Hi,
    Scenario : There is PAR which I have developed for the sorting options for a Search Component set to be used in Km Search Iview.
                   I have copied this PAR from a similiar search functionality and customised the same.
    Problem: When I deploy the PAR and then map this class for the sort options while creating a New Search Dialog box :
    I get the following "Class not found error" ... Please can you let me know what could be the problem.
    Any help would be appreciated here as I have tried all the possibilities to solve the problem.
    Regards,
    Vaishali.

    I modified the xml file as described in the forum.But the error persists.
    One interesting thing is:
    When I create model after restarting the NDS,I get the following error:
    org.eclipse.swt.SWTException: Failed to execute runnable <i>(java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library librfc. Found version "620.0.1237" but required at least version "620.0.1374".)</i>
    I get the NoClassDef found error next time onwards,
    Where do I get the 620.0.1374 version of librfc?
    thanx.
    Bhupesh

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • Additional Dynamic Selection criteria for Vendor-Search Tearm 2

    Hi All,
    I need to incorporate additional dynamic selection criteria which references 'Vendor-Search Term 2' in new Z Transaction which is a copy of Transaction S_ALR_87012086.
    help me out how to proceed.
    Full reword points will be given.

    Hello Chetan,
    have you checked note 79166 "MM-SRV Hint: Vendor evaluation for service"?
    Define an evaluation criterion for services in Customizing of the vendor evaluation to be able to use the vendor evaluation also for the services management.The main criterion must contain the determination methods 'C' (determination from the quality valuation of the service) and 'D' (determination from the timeliness rating of the service) in the sub-criteria.
    Kind Regards
    TomT

  • Dynamic mapping for alv

    Hi All,
    I need to display three tables  using alv.
    i have used one alv component  in my application.
    In my context  i have three nodes ( for three tables )
    when i am trying to map  one node of my component control to  'DATA' of alv component
    its working fine. i am getting the data of one table .
    Now , my problem is for the remainig two tables . how these two nodes are mapped for the same alv 'DATA' attribute of alv component.
    Whether i need to create  two more  alv components or Is there any possible to dynamic mapping ?
    Thanks and Regards,
    sravan.

    Hi Sravan,
    Now , my problem is for the remainig two tables . how these two nodes are mapped for the same alv 'DATA' attribute of alv component
    You cann't map the multiple context nodes to the DATA node of interface controller.You have to declare 3 component usages.
    or
    you want to set the map the dynamically then use this code.
    data:l_ref_interfacecontroller type ref to iwci_salv_wd_table.
    l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
    l_ref_interfacecontroller->set_data( lo_node ).

  • Dynamically generating file names for 2 File ( 1: 2 mapping transformation)

    Hi ,
    I have a scenario Proxy to File(FCC) with 1:2 transformation in message mapping ie 1 sender and 2 receiver interface ....
    1 Message mapping
    1 Operation mapping
    1 RD , 1 ID and 2 file receiver channels  and 2 receiver agreements.
    I need to dynamically generate the filename say abc.(first 9 characters of mesg id) and xyz.(first 9 characters of mesg id)
    I used dynamic configurations with ASMA settings, created 2 UDF assigned each of these to header node of r receiver message types.
    Here, I guess the second dynamic configuration is over writing the first dynamic configuration and hence creating only one file with xyz.(first 9 characters of mesg id)
    name .
    Need your valuable inputs
    Thanks and regards,
    Pavithra

    As dynamic configuration doesnot work in case of 1:n mapping what  you need to do is
    Create a field Filename in your source data structure
    Create a1:1 mapping between your source structure and source structure
    In that 1:1 mapping on the target structure assign UDF for file name
    Now this target structure will be used as a source structure in your next 1:2 mapping
    Under operation mapping add first the 1:1 mapping for source and then the multimapping
    regards
    Ninad

  • Maps for iPad quits when I type in the search line

    I can't search in Maps for iPad since it quits every time I try to type something into the search line. I tried restarting the iPad and even restored it from iTunes. Still can't search without it shutting down. I'm at a loss for a solution.

    Exactly the same here. Tried almost everything I can think of. Honestly, this is bordering on the completely unacceptable, as if you can't ever enter certain letters, there's no way to search on maps, or anywhere else on the iPad, and this is one of the main reasons I bought it - for travelling in foreign cities.
    Perhaps coincidentally, a lot of apps just seem to crash like maps do, but only on the iPad, not the same apps on my iPhone.

  • How-to map multiple explicit search help values to context attributes?

    Hi,
    I have a custom explicit Search Help with multiple attributes set as export and uses search help exit for data retrieval. I have set this Search Help for one of the context attribute that is binded to one of the input fields on view.
    Now, is it possible to dynamically map other export attributes from this Search Help to other Context attributes?
    I know this works for Input helps that are directly derived from check tables but not sure how to do it for explicit Search Helps.
    Can anyone please confirm and let me if this is possible? If yes, then can you please share an example or describe how to do it?
    Thanks and Regards,

    Hi Srinivas,
    Check this ..Search help can be dynamically assigned to a field.
    data lo_nd_info type if_wd_context_node_info.
    lo_nd_info = lo_nd->get_node_info( ).
    CALL METHOD lo_nd_info->set_attribute_value_help
    EXPORTING
    name = 'ATTR1'                  " Your attribute Name
    value_help_mode = '121'    " Valid value help mode
    value_help = 'Z187442'.      " Search help name
    The various possible values that you can pass to value_help_mode are as shown below.
    deactivated 101
    automatic 111
    ddic 121
    ovs 131
    Also refer this..
    Re: How to put dynamic search help in web dynpro ABAP.
    Cheers,
    Kris.

  • Purchasing cube designing, update rule mapping for 0calday

    Hi All,
       Iam designing cube for Purchasing module in BW. Iam having doubt in mapping for 0calday in update rules, is it with document date or scheduline date. I have searched in SAP cube 0PUR_C01, it is mapped with 0SCHED_DATE( schedule line date). How the difference comes when we choose document date and schedule line date.
      FYI, we are using only schedule line data source, which is giving relevant information.
    Thanks,
    Ram

    Hi Ram,
    Please note:
    0SCHED_DATE: The schedule line date is the day on which the scheduled quantity of the material is to be delivered.
    0DOC_DATE: The date on which document has been craeted.
    Use the first one for purchasing.
    Thanks...
    Shambhu

  • Search Item drop-down does not show any data for Advanced Search.

    Hi,
    I have a requirement to add a new criteria to the existing Advanced Search region of 'My Employee Information' in Manager Self Service responsibility. I substituted the AdvancedSearchVO to include the new column. Using personalization i did the below steps to show the new column in the page,
    1) Created a 'Message Styled Text' item under Table Layout region to display the result. I associated the View Instance (AdvancedSearchVO1) and View Attribute (AttrColumn).
    2) In Advanced Search Panel created a new CriteriaRow and set the 'Search Allowed' property to True.
    3) In Advanced Search Mappings i tried to create the new mapping but the Search Item drop-down does not show any of the CriteriaRow item. But Results Item shows the 'Message Styled Text' item created in step 1 above.
    Any idea what i would be missing becasue of which 'Search Item' property does not show any data?
    I am using OAF version 12.1.1.
    Thanks, Suresh

    Hi,
    I faced the same situation but i still waiting for the solution.. this is my problem's thread..
    Addition of LOV Search Filter using Personalization
    But when i tried to create a new custom page with advanced table and created a new LOV column via personalization. i was able to create new search mapping.. but this is not happening in the seeded page case :(.
    I m also looking for solution...if any one can provide some inputs on it , will be highly appreciated.
    Thanks
    Renu

  • ABAP Mapping for Error handling in Proxy to JDBC

    Hi All,
    I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)
    I am following the below steps,
    step 1 - In message mapping a UDF is created to catch errors and store them in a variable using  dynamic configuration
    step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception. The exception format expected is
    SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
      <SAP:P1>ZPI_THROW_EXCEPTION</SAP:P1>
      <SAP:P2>001</SAP:P2/>
      <SAP:P3>Mandatory field is missing[BUKRS] </SAP:P3>
       <SAP:AdditionalText />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I have written the following ABAP code to achieve this:
    method IF_MAPPING~EXECUTE.
      DATA l_record type mpp_dynamic.
    DATA error type String.
    getting dynamic configuration value
    filled in by any previous mapping
    CALL METHOD DYNAMIC_CONFIGURATION->GET_RECORD
      EXPORTING
        NAMESPACE = 'http://sap.com/xi/XI/System/ERROR'
        NAME      = 'ERROR'
      RECEIVING
        RECORD    = l_record.
    error = l_record-value.
    *raising exception with our message
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
      EXPORTING
       TEXTID =
       PREVIOUS =
        ERROR_CODE = '001'
        ERROR_TEXT = error .
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
      EXPORTING
       TEXTID =
       PREVIOUS =
        ERROR_CODE = '003'
        ERROR_TEXT = error .
    endmethod.
    I am gettign the following message for our code:
    SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>No receiver could be determined</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Could you please help in finding the solution for getting currect error message from ABAP class?
    Edited by: SwethaC on Jan 21, 2011 8:18 AM

    The error is due to RFC Call fail from PI system to your ECC Application System.
    Check your RFC Destination for ECC System type 3 in PI System.
    When you are receiving data from ECC System using Proxies & again you are going to ECC System for Validation.
    Why you are not doing this validation on ECC System only in your proxy code ?
    In your proxy code, it will be much better for performance to check your data there on same system.

  • Error in code page mapping for Source System

    Hi All,
    We are Loading data into BI system from MDM System.
    It was loading fine but Yesterday we got an error " Error in code page mapping for Source System"
    Message Class: RSDS_ACCESS 13.
    We alreday tried to Search any IDOCs with error/unprocessed , but there isn't any.
    Any pointers for this error will be Helpful.
    Regards,
    Mayank

    Our SP currently SAPKW70019 , the SAP note mentioned above required to apply SP for 13, which we already beyond that...unfortunately we still face the same problem .. almost every day ..
    any advice.. ?
    Edited by: Edi Erwan  Abu Talib on Jun 22, 2009 8:22 AM

  • Error in codepage mapping for source system. Error

    Hi BW Experts,
    I am facing following error:
    Error message: Error in codepage mapping for source system. Error text:
    Details: Inbound Processing ( 1000  Records ) : Errors occurred
                Error in codepage mapping for source system. Error text:
                Update PSA ( 0 Records posted ) : Missing messages
    I repeated the delta working and everything fine.
    Does anybody know why this error occurs?

    Run rsa13 (for bi 7.0) find your source system which one you are using for data transfer and double  click on it and find special options there select  the optioned i mentioned already.
    Please search SDN you can fin threads related to this thread
    if not let me know.
    Regards.

  • Ovi map search offline problem

    Whenever I search for a location offline on my E72, I end up with no results available.
    After fiddling with my phone for the better half of a day (including first using online search then turning off the internet to use offline search), I tried deleting all the maps on my memory card and installing only the maps for the areas I need through the OVI suite. Having read earlier threads on this topic, I was sure to wait until the index files were fully transferred.
    Now the offline search works, but only for locations within my own city. For locations in the neighboring city, though only a few dozen miles away, I end up again with no results available.
    Is this normal or is there any other way I can try fixing it? Thanks.

    Hi sherryglass
    Unfortunately I think it is also related to size of country, as with world maps on E72 I can do detailed search of UK "Offline" but say for example USA it has to be "Online"; that said access point in OVI Maps application can be via WLAN or network.
    Happy to have helped forum in a small way with a Support Ratio = 37.0

Maybe you are looking for

  • Hi how do i get video to show on macbook pro i only have audio playing

    how do get video to show i only have audio playing on macbook pro

  • Generate HTML REPORTS Help

    hai.... i am new to this field i need some help regarding how to generate html report ... well i am using db2 as my database .....and these reports are not crystal reports..... i have to generate some fields information from multiple tables in the da

  • Writing a whole class instance to a file

    Is it possible to write an intance of a class to a file whole? My problem is as follows I have a complicated class system for the piece of software i am currently writing this has vector classes upon vector classes upon vector classes etc. The top cl

  • Using JCE with java web start

    We are trying to use bouncy castle provider in an app that is distributed using Java Web Start. We sign the jars for use with jws so that they have unrestricted access. The problem is that bouncy castle provider jar is already signed, and jws does no

  • Cinemagraphs | The Russell Brown Show | Adobe TV

    Russell Brown shows you how to use Photoshop CS5 to make a Cinemagraph - a mostly static image with some looping motion in it. http://adobe.ly/wGzK7f