设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13379|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* i9 h' @& z& M9 x2 K* y

: q8 N& X( a. d; w- H9 c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 e/ k. B7 P& c
( t0 R" I4 v! a; ~* pbegin P_read arriving
, U/ }$ Z1 }5 H6 r4 p    while 1=1 do begin/ T& i, g* o  Y+ U- w* q
        read A_tote from "data.txt" with delimiter "\n"9 ?1 V/ k; \+ o$ Y, o
        read A_time from "data.txt" with delimiter "\n"
+ M! l5 @' L( q  U& v        read A_leave from "data.txt" with delimiter "\n"
9 [8 x8 \' G2 r7 ~        read A_picks from "data.txt" with delimiter "\n") l. A6 X- m; a$ l
        set load type to A_tote" U: w+ _4 R- h
        if A_tote="tote 1" then set A_induct to 1
7 [3 o0 K4 g- y1 G+ Z" v        else if A_tote="tote 2" then set A_induct to 2
! `( `% F4 W8 r) d) e) T! ^            else set A_induct to 3   
8 \, t* W4 z: I: K$ N+ O9 E8 r$ X        set A_i to 0
8 V4 {$ _( L. S& ?# o# O        clone 1 load to P_induction# F- F5 j7 W6 A: I/ i) y. Y; }  r
        wait for A_time sec# @% ?4 L& [- d9 @' H* `
    end
8 X7 Q$ d% l5 P: Cend4 ^- |( L9 s4 A) X1 g

8 `: G6 @. q6 D; N. i4 y9 d5 Jbegin P_induction arriving
" @2 u% q+ ]! ~& B* ?    if A_induct=1 then clone 1 load to P_pick1
3 h" u+ Y) t. K2 g2 ?9 Y, g% S# A    else if A_induct=2 then clone 1 load to P_pick22 B; C9 U  K& }0 m" j
        else clone 1 load to P_pick3( [' G# W: {  O9 d7 S! I) r
end
% v& d# o1 y: z7 ^* H4 m1 ?* m5 Y; m, T
begin P_pick1 arriving6 }; F2 l0 ~1 y
    set A_i to 13 v' Z1 G# f$ b& C& _0 L
    move into Q_induct1* R9 E+ a# P0 x0 D# v- \  m
    move into pickaisle.induct1
" [' T4 z- `0 ?% L: y! @  T    while A_i<=30 do begin) U* M( ^8 w  O4 X9 H1 D3 @) I5 N
        travel to pickaisle.con(A_i)1 \$ b- J" {* G9 t( R/ ^" M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% k5 H0 A! Z8 ~# o        else wait for 10 sec1 P  E; [0 r2 j% A
        if A_i=A_leave then send to die6 x8 g" K+ m" U
        else inc A_i by 19 ?$ O8 ]- ]9 a% y
    end
& y2 g/ W. V9 g6 S+ A, Uend
) p' v$ V( z  v) z  r7 L" ?, ^8 M
" ~0 V7 R/ {/ Wbegin P_pick2 arriving. Y& q, b6 `( w* P5 Q
    set A_i to 11
' V, h, A1 d) O1 F' p! L7 e0 C    move into Q_induct2
+ }+ Z' a+ J" C& k+ [    move into pickaisle.induct2
; |. c! E9 z1 Z/ a$ |  Q    while A_i<=30 do begin6 l$ [: W0 f! }! t! P& Z
        travel to pickaisle.con(A_i)
7 m4 ^4 `9 D' D9 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  T" J  R5 ~: {4 g+ y        else wait for 10 sec% `7 \# r3 g3 V5 b7 I& v1 j
        if A_i=A_leave then send to die6 j# a- f4 m4 d& |
        else inc A_i by 1* [. F' N! d& H# R
    end, q% g( j4 i) ]$ ^$ N: X8 I1 x' |
end
+ D9 y; f( @- y% ~
& B" B2 P& b  o; abegin P_pick3 arriving$ X8 |# w' D- [% c! U  e
    set A_i to 21
$ [9 U( |* N  ~, p! b7 J    move into Q_induct3
4 B. X, n3 _; [: A8 G    move into pickaisle.induct3' c) r' C6 B) t1 R
    while A_i<=30 do begin
) U! t7 }+ }2 e  ?0 m, {* x. f        travel to pickaisle.con(A_i)
& }1 a% V& p9 r6 E9 H4 \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- d2 n3 ?& m- Y6 Z2 v+ \
        else wait for 10 sec
) @# s; c3 C7 F) \$ n4 E% Y        if A_i=A_leave then send to die8 Z$ f! c+ f! ~* k, h+ p
        else inc A_i by 1  b! d% D. r7 z% ~* s" C
    end$ \- R* c! t* ]
end

最佳答案

查看完整内容

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是个什么东东?/ @( n$ m$ M" o5 v4 R
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
) @8 f* z! e% P0 q# G* Q7 ~
) F- T$ X: R6 i. @AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- Z3 C9 R4 _5 X! K" r: a
3 \& V0 M- {! a% |3 T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) Z7 ^7 o% D) j+ \. b% _  S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
( U1 a% n5 L0 |2 y0 c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;; Z9 e$ e. o  I  ^0 ^8 W
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: a2 U0 G3 d" A; P( [# m0 D* {" p/ C- z
begin P_induction arriving( d- p  O- z" J  ^* t' }
    clone 1 load to P_pick(A_induct)2 O0 ?3 e, ^% @
end最大的系& ^! [6 B1 r% N

( P1 }) S, w8 `* u4 r& [begin P_pick arriving: U' w5 \4 x! ?/ `2 \3 o
    set A_i to procindex * 10 + 11 x& i5 w8 O$ M% q
    move into Q_induct(procindex)5 _9 D& P3 e! W& C+ q; G
    move into pickaisle.induct(procindex)& I1 R" a' P7 k! x/ K
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 b1 ~1 R. t8 L: s4 U9 _" Z% U+ R# d; M$ Q9 d
    while A_i<=30 do begin) M- g1 m) B( p
        travel to pickaisle.con(A_i)6 k) K6 I& |: e" d, S2 Q% K& N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 ]9 w* P$ H* G6 x' N
        else wait for 10 sec
( }+ A3 r' x' Y- O! J7 K# w        if A_i=A_leave then send to die0 R7 B7 I, _4 [+ K7 X
        else inc A_i by 10 w5 p4 D3 s% \$ P- U* ]6 h
    end
" h" O4 O0 b' f  O3 Z3 cend9 g0 n# z; Y- [2 V2 Y' X
7 Z# Z8 `7 ^. m0 `3 y! o
其中的procindex为整形,代表当前process的序号。4 p2 O4 G( k: P1 _
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-4-8 19:28 , Processed in 0.022709 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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