设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14489|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( m0 i& Y. a2 a  ^. P; d8 l

+ b5 ^: P% 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中的数值,不知道会不会有什么不妥。3 L* W0 S# u; l  d& F+ \1 D

7 G  L4 ]0 j- j* ^/ abegin P_read arriving
8 o9 {2 {# L. d* A! @! L    while 1=1 do begin! b1 O1 |9 |& O1 Q5 i$ B
        read A_tote from "data.txt" with delimiter "\n"/ {0 A1 y; \- h4 E
        read A_time from "data.txt" with delimiter "\n"
" q; r$ l# p5 b5 I" z1 ^% ?        read A_leave from "data.txt" with delimiter "\n"1 ~; s9 Y9 z5 k$ z7 C0 U
        read A_picks from "data.txt" with delimiter "\n"
/ K; p' f' I2 s- c2 I5 c1 R, ]; u        set load type to A_tote( u3 j1 c; H- h: Q# v5 v2 C" q
        if A_tote="tote 1" then set A_induct to 1! V, |$ }& ?8 f0 P! Y* h4 ~
        else if A_tote="tote 2" then set A_induct to 2
9 z) Z, S1 ~+ T            else set A_induct to 3   
8 S% X% t, q+ R' D0 ^7 ^        set A_i to 06 a. s* M' W2 C- k& d
        clone 1 load to P_induction# _9 N/ m' n1 B, t% d3 U
        wait for A_time sec
3 ]) u, ?! n& i8 S1 V    end8 D- f/ }' Z. q$ q' q
end
1 y" x: N# f  ^1 G) y% f% u. a& m( f
begin P_induction arriving
, ]# l( a1 n7 E3 O+ K0 }& C    if A_induct=1 then clone 1 load to P_pick1
- F5 J, U7 m: Y" g! k8 b    else if A_induct=2 then clone 1 load to P_pick28 }" h  r, [! w
        else clone 1 load to P_pick34 i' g5 C$ q; T) Z4 N7 U2 F% g
end
& ]- Q: X4 o1 J
. h! _6 G5 n5 obegin P_pick1 arriving7 A* D( I  q/ i: h) M
    set A_i to 10 e- o4 I' ]3 @5 q1 P8 r
    move into Q_induct1) G( X; {" @: v: b0 a
    move into pickaisle.induct1
+ n' r) W7 i/ G. |3 ?, f1 e    while A_i<=30 do begin
* _$ Z- r( |$ b9 z. o8 j9 ~        travel to pickaisle.con(A_i)2 u4 N8 d, i6 b$ [' u, M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& ]# {. @: t2 C! I
        else wait for 10 sec
) J+ f' A# q5 a" y8 {* x6 j. o        if A_i=A_leave then send to die# ~, N2 ~% _/ m: R& E' Y; x
        else inc A_i by 1
, N, N8 Z5 B; p, K0 E; h& o% d; A$ J    end
: ]$ G8 s; j+ U. Yend6 n2 _* I3 O: X2 ?  e5 V
0 u" \- _  j) n5 P' D9 X# ^& p
begin P_pick2 arriving
- R, v+ k/ G3 Y/ }) l: n* {  L+ D    set A_i to 11/ c9 j. b9 `- \5 R
    move into Q_induct2
; N4 M& t4 @4 I2 ?% O1 B    move into pickaisle.induct2
" e* j9 S' W% ~" J& U9 T    while A_i<=30 do begin# @* R; C. r: c' [: S1 F
        travel to pickaisle.con(A_i)2 U1 a2 Z5 `! w7 p! Y0 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 ^/ W! H6 v( {2 ?
        else wait for 10 sec
& X! M, X0 O2 U$ I7 D& A        if A_i=A_leave then send to die
6 k/ @; ^6 ?: g7 w        else inc A_i by 1
% B8 A  T2 ?, \) z$ |" K    end
. ]) \; p3 a# z2 R, P! Oend8 l8 h. g+ H, b( g

" |4 b' p8 F2 Y2 {begin P_pick3 arriving
; T+ u  f7 q( I: ^: S+ m$ x    set A_i to 21# n* `: }  ~+ |1 J  h9 S! g
    move into Q_induct3, D) Y+ X9 g+ I' X( M
    move into pickaisle.induct3) p- |2 G+ s* `, o1 j3 F
    while A_i<=30 do begin" a6 C! i6 _9 @- C6 r$ a. g
        travel to pickaisle.con(A_i)/ N' V: v4 Y$ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ?! t( }2 j3 |        else wait for 10 sec' J8 i  b0 v9 n0 u5 v$ f! A( v" p2 J
        if A_i=A_leave then send to die+ d5 s8 s* f6 ~( c. V5 N
        else inc A_i by 1
6 l. G) C* ^* g6 V& b% [# |: W    end' h% X' r1 |# f& M' P
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是个什么东东?
# D6 S# W2 B! ~# O  {move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& _( }( G6 b0 i% d* q0 j
- h/ X* D4 j* z% P* P; L) f" s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) L! {4 @9 u, H/ D/ O
$ K$ a/ ^8 Y, {7 {7 w7 P
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
- o# M; `& A2 a! H, B2 }1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 {  }* I# e+ v0 H: e6 ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 B) U2 R, u4 |
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:+ _* g* p& Y+ Q2 G
begin P_induction arriving, L4 B$ p* W6 N
    clone 1 load to P_pick(A_induct). T/ U: M( g3 R  j; f1 W9 ~
end最大的系- N9 c+ M: N8 s' ^# \
) B; J2 ^! F  H4 }: b" q
begin P_pick arriving: y5 U1 c7 a; B* v* ^
    set A_i to procindex * 10 + 1& t) U4 u% C- j1 Q1 M
    move into Q_induct(procindex)* T: k3 {* ~! ~
    move into pickaisle.induct(procindex)( h- ], j( r+ V# e
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 t8 U( t) ]! N) j" U' M4 a. X( L4 _  ^! w- f; [
    while A_i<=30 do begin
' p6 k# `5 r3 M$ J* H/ f, }9 a        travel to pickaisle.con(A_i)  T- ]! P3 e" q; b* G2 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( s$ a" {# L/ K) L( {- `2 G6 e        else wait for 10 sec
: a+ T. s* }, i7 X# ?4 t: _        if A_i=A_leave then send to die
/ K4 I) _& q4 g        else inc A_i by 1
/ d7 P: @2 m8 r7 [- h; ~; k    end
0 D& i& C8 G: P* ?/ xend3 G5 R1 U# Z) {* V- E

9 F0 F9 I1 j1 C) u其中的procindex为整形,代表当前process的序号。
+ `0 q) _9 \  F7 O* Tstation和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-7-14 11:28 , Processed in 0.015519 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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