设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13974|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( t* [! ?# e6 H6 _  R7 Y$ [2 m+ X

2 X( U3 M: f% y- N; i  t$ s我的问题是,在每个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中的数值,不知道会不会有什么不妥。; a# S- h* v4 M, j$ C

, A0 \4 p( z$ Gbegin P_read arriving7 Z2 c: g6 X1 p1 ?3 z4 C' s- _0 d
    while 1=1 do begin
. X5 T# i" m2 i        read A_tote from "data.txt" with delimiter "\n"
9 S' g& \; e3 I5 G# [        read A_time from "data.txt" with delimiter "\n"
, L% X2 r; d1 d+ t7 N        read A_leave from "data.txt" with delimiter "\n"0 G4 E* `' o* ~1 W/ b; C
        read A_picks from "data.txt" with delimiter "\n"
) v7 B- b/ A6 y& c        set load type to A_tote6 ~9 m. B+ R; ?2 s# k+ t
        if A_tote="tote 1" then set A_induct to 1
8 \  c: l7 M2 ]3 f6 ]0 a3 O        else if A_tote="tote 2" then set A_induct to 2
: `7 E4 s# u) S1 N  p            else set A_induct to 3    & c9 d3 k/ c- x( Y# G
        set A_i to 0
- e% @: \+ ]' I1 q, F        clone 1 load to P_induction
  l2 R7 z9 X5 w+ x. j- Y% z        wait for A_time sec" l3 \% y& @5 i0 _/ }- y
    end
( a) U' e0 l; U  tend7 H5 o4 H! d& s" ~0 v% e. n

- I; d8 |3 \: o; M3 Q( n0 Ebegin P_induction arriving. D% ?3 r3 L+ W9 v9 j, X
    if A_induct=1 then clone 1 load to P_pick1
+ _* H3 s% F% a7 j6 m- H- m" k0 U: H    else if A_induct=2 then clone 1 load to P_pick2
5 ]" X+ E; r. I        else clone 1 load to P_pick3/ F" K6 m7 a5 o' ^* z& N% A3 s
end8 m& e3 Q" d; ~  y: n

; N7 @' \, M- J( [3 t9 Mbegin P_pick1 arriving+ p# t& p9 t2 v- }* u
    set A_i to 18 j2 x' X# g* }8 r) Z8 p' k
    move into Q_induct15 ~* D! x) n* T( |5 `4 R9 U" o
    move into pickaisle.induct11 q7 K0 k! G7 h/ k% W; `3 v
    while A_i<=30 do begin
6 C7 d1 P( e; o: N+ I        travel to pickaisle.con(A_i)
! m* j, I. o4 ^) o, k& B( }1 p& p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 Z% z$ a1 W) G: N7 j# u0 }
        else wait for 10 sec' m- C2 S1 z* f* w4 ?5 R
        if A_i=A_leave then send to die0 M$ h9 H8 S( V+ v
        else inc A_i by 1% v  _- O, N/ X& ?  |/ B; O
    end6 K. J5 E# o: X
end
" O+ O: L6 `" G  R0 j3 z& `8 y% Q7 }2 f- F
begin P_pick2 arriving4 b! P" R' B5 Q! K- b; O
    set A_i to 119 @- o/ Y0 w: a& t
    move into Q_induct2
  s* G' p6 {. s5 _+ o    move into pickaisle.induct2
; [& E& J6 S" F, `6 F" G. }5 Y, ]5 e    while A_i<=30 do begin
6 q- A$ i: `+ A, s& V& a        travel to pickaisle.con(A_i)* [6 ^0 J1 M9 F3 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# [! ^6 M. |/ `; A5 d4 s3 t$ I7 Y$ y        else wait for 10 sec  |$ R- V3 n( g' x. B2 ]: [
        if A_i=A_leave then send to die7 |  d" P  i8 U# _$ x# y7 M- _
        else inc A_i by 10 J0 _/ q; H# X
    end
( u/ z! e" y6 Oend
. i7 ~8 A3 `4 d0 o2 R: c! Y5 n6 g" x" W3 o9 x, ^; V1 T  _
begin P_pick3 arriving6 V. S1 @1 e0 ~+ e2 z& f
    set A_i to 21
: K3 F. B& W9 C8 j- a/ Y4 \5 t    move into Q_induct37 O' K  s  w; l' [8 M' w# b
    move into pickaisle.induct3- t9 ?" a. K- X+ V% o
    while A_i<=30 do begin1 y  z: Y5 v: X) o& N4 e; T4 M" p3 P
        travel to pickaisle.con(A_i)/ ?* r+ u" E5 ?5 s' e) [( O4 C3 o: A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 J& K- e7 S* _/ V& l
        else wait for 10 sec
1 Q8 W* z5 W8 O' ~  B; B( _        if A_i=A_leave then send to die8 n: g4 A4 P- ~# i/ ], d& J
        else inc A_i by 1
$ x6 l1 y" L5 e6 U* N: ?% M  w" V    end
8 a/ K% P2 j/ vend

最佳答案

查看完整内容

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是个什么东东?2 n3 @- @0 a, g/ |8 q$ r
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
/ \. V& f) J( K3 h6 U0 B" Y. R" M; I$ V* _
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 a; F3 V! G# A* G# z

2 F$ `7 ?( O6 }( c) q; E, L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( I: j+ x* r0 \. r& P
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& _8 r0 U  x5 \; ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;  S4 N( S# ?0 L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, q' @# L- ^! e& @( G" J' a7 |begin P_induction arriving& J. G; ?$ l5 W
    clone 1 load to P_pick(A_induct)8 ]' s6 Y7 k& t3 U
end最大的系# C% G# m2 M- Q' o0 h
0 m# s, o. [$ t+ j
begin P_pick arriving
. J9 t) p. I# R, b6 V4 J    set A_i to procindex * 10 + 12 O. b6 n% {" |
    move into Q_induct(procindex)7 G9 ]" v! _5 n; e
    move into pickaisle.induct(procindex)
2 {- J1 p+ ^2 y" [/ f    /*check the type of pickaisle.induct(i), for your last problem.*/
7 [0 B$ m( x* a+ `2 v! }3 n$ T9 D. v5 G8 f- t* `
    while A_i<=30 do begin( B+ E! `- ^6 s3 r0 X1 }2 Y
        travel to pickaisle.con(A_i), a: R9 X1 n4 K1 J5 W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [+ I0 q' `& [7 h
        else wait for 10 sec
# U3 s1 K2 M  e        if A_i=A_leave then send to die
$ w1 q" M0 s( O9 A        else inc A_i by 1
2 H$ d) k& Q0 r3 K( Z6 _0 w6 L    end
. w# l3 W9 \2 ^9 G$ |end7 `4 g0 T+ B- M/ P% `* l, ]

' w7 |9 s( f5 u4 E) Z3 g其中的procindex为整形,代表当前process的序号。# B% n2 x3 v% E2 Y1 i
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-26 10:53 , Processed in 0.019841 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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