设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13723|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 Q0 z& T( i- }
- x- D9 P9 u, {
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
# L& b$ {; r  a. K( U% X7 ]5 t$ O' P9 g9 T
begin P_read arriving6 |: ?* O0 q6 L2 d; C
    while 1=1 do begin0 w9 d" F8 Y9 l' r" P" q
        read A_tote from "data.txt" with delimiter "\n"4 N: P$ U- o( ?: h7 ]' a4 C7 @% ]
        read A_time from "data.txt" with delimiter "\n"2 z! H4 A& Q$ [
        read A_leave from "data.txt" with delimiter "\n"& H, |$ v% u4 b3 ^% o3 x
        read A_picks from "data.txt" with delimiter "\n"% n9 f0 J4 \4 [8 W6 j; B0 V
        set load type to A_tote
" s) Q8 [+ n: w6 o" f0 f: X+ d        if A_tote="tote 1" then set A_induct to 1
6 {- H  J3 H  b* m5 t        else if A_tote="tote 2" then set A_induct to 2. M  z& S" [" ]4 n
            else set A_induct to 3   
' t" x3 F3 @% c- G- |        set A_i to 0' a( ~2 D5 h% m% M" N
        clone 1 load to P_induction  Y3 {+ h; m& P2 j% T
        wait for A_time sec
1 X; i  B3 z. C8 j( s! Z# h    end
7 M  S& c8 m/ M! I  Z0 Tend* y/ q9 V, Q; r% x, J5 k  k, U

% c, |$ |% L. D0 s) Lbegin P_induction arriving8 d7 }+ R! Q6 b' Z
    if A_induct=1 then clone 1 load to P_pick1
1 Z: Q$ |9 v8 J7 Y    else if A_induct=2 then clone 1 load to P_pick2
+ \* x$ F0 ]) H  ~        else clone 1 load to P_pick3" _; e8 Y0 K8 @& ^' \
end, ^( F1 |0 ^& f+ F' C' h. Y. X, ?
4 Z! b$ l# V! X( ?2 i" J
begin P_pick1 arriving
0 i( @- E& ^0 w    set A_i to 1
4 j8 u. ^! h1 O) j" n/ z0 S/ h! G    move into Q_induct1+ F1 |9 T  y$ m% i0 k7 d; k" s+ E
    move into pickaisle.induct1
0 k0 i3 d, W; J7 Z( ]0 F  e6 Z    while A_i<=30 do begin* a  d7 q1 m+ {- @
        travel to pickaisle.con(A_i)
4 D8 @2 E5 T9 c+ O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# Z5 s/ o6 W, y) S$ o        else wait for 10 sec
+ T6 b, X* v5 Z. O( B) G6 @/ i        if A_i=A_leave then send to die% }: E+ V0 m: [% N+ i/ }
        else inc A_i by 1( t5 {) Z- {! Z; Y
    end
% G) `0 }% o3 s, `$ oend
/ t& Q' U' x% R; E9 T6 U' A9 V% M7 v9 o( h
begin P_pick2 arriving/ A' ~2 F5 e( T6 J% ?
    set A_i to 11
/ Z$ @# p7 a0 ^$ i    move into Q_induct2
2 N# q. V3 q$ u' t; G. S/ {    move into pickaisle.induct2. o5 s3 u. x9 s8 I
    while A_i<=30 do begin  S) A4 t; ]. C9 ~
        travel to pickaisle.con(A_i)- j& h' o) }8 f  G& O; e) }
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 O  a) Z5 e' L4 {
        else wait for 10 sec
( k1 O' C  l9 p, f* |0 S/ i+ f$ p        if A_i=A_leave then send to die
2 T4 U4 e$ S1 Q* y0 F7 Q3 t( s        else inc A_i by 1
2 Q  ~% E# A, g' u  K    end
- f# C; N! }- k8 j) x* [+ M( j2 Dend  I) B' _# u" ^4 H: |
7 c* k( Q1 Q& ~# Z
begin P_pick3 arriving3 j- [. G2 h* O% U9 ^
    set A_i to 21& k1 {6 c* u# L/ C9 f( G
    move into Q_induct3
* j+ k& ~0 ~9 V    move into pickaisle.induct3
3 z2 Z! f7 S" X1 k: `    while A_i<=30 do begin; m5 Q; I4 T3 n; b9 T
        travel to pickaisle.con(A_i)+ p) ^$ g0 O; ?% @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _  ~% I: @) J8 a: N        else wait for 10 sec
# U, [3 j9 P# b) ~7 @2 k; |        if A_i=A_leave then send to die: k! g3 x1 p; p& n& J
        else inc A_i by 1
1 n' F# W, F- x: r' ^& @% T    end
" x5 L& Q# G$ i( @2 U: m) R. Dend

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
( v; J! {4 D) Cmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
+ a; E: V+ O: m9 ]2 Z0 m9 B5 N$ u2 T2 ?( V! T$ P
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 b# E/ f" X/ K- A
+ a) N- _4 a4 R( L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  K4 I; C1 S, E2 o  E! m7 w
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
" L# f+ k9 D! I0 Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, }* z# {9 b. M; g( F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 z8 {! \, R. q0 ~( c
begin P_induction arriving
) A, S5 C1 p8 }' {    clone 1 load to P_pick(A_induct)
# v* [- d5 c: A- Send最大的系
) x9 H5 D! u( e' d$ l' C5 Y" `( f  V- G( H
begin P_pick arriving8 x' u0 m: O/ l3 g
    set A_i to procindex * 10 + 1- B( n5 j+ ?/ H# ?8 ^; H9 q
    move into Q_induct(procindex)
; N; Z" X" W( R: M4 C% @( x1 z3 ?    move into pickaisle.induct(procindex)  q# M2 A8 }' J8 A
    /*check the type of pickaisle.induct(i), for your last problem.*/
( P+ I3 @5 x$ c
/ v- v) f: N' z; Y$ ]+ Y) X5 Q    while A_i<=30 do begin. D# B) x/ z( n2 {7 D# m9 f4 a/ d
        travel to pickaisle.con(A_i)) s% W2 ~7 ~' A. q, P( c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^) Z! ]7 E, k2 u0 i! ]        else wait for 10 sec
3 v; F2 P/ Z% ^3 z  D        if A_i=A_leave then send to die& ~1 w+ r9 @/ Z/ I# g/ ^, [
        else inc A_i by 12 K! @% V" ]# m/ [
    end
! Y" O- |  Z  f1 z6 D6 Xend' o0 f3 @& W, c2 ^5 X) ]9 w0 l

6 K2 n, u7 }9 P* C" ?; E5 l* G其中的procindex为整形,代表当前process的序号。
3 n: Y3 R& u4 [station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-5-1 05:18 , Processed in 0.019034 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表